Fix T56720: Lattice: crash on setting points_u/v/w from python.

One need to check that there is something to free, before trying to free it...
This commit is contained in:
Bastien Montagne 2018-09-08 15:29:39 +02:00
parent 59eaa90300
commit 4594cc25ac
Notes: blender-bot 2023-02-14 07:30:31 +01:00
Referenced by issue #56794, T56773 isn't fixed +++ GPU render with Blue Screen or empty GPU tiles
Referenced by issue #56773, Latest Blender/Cycles build will crash in GPU mode (Blue Screen with 4594cc25ac)
Referenced by issue #56720, Lattice: crash on setting points_u/v/w from python
1 changed files with 3 additions and 1 deletions

View File

@ -216,7 +216,9 @@ void BKE_lattice_resize(Lattice *lt, int uNew, int vNew, int wNew, Object *ltOb)
lt->typeu = lt->typev = lt->typew = KEY_LINEAR;
/* prevent using deformed locations */
BKE_displist_free(&ltOb->curve_cache->disp);
if (ltOb->curve_cache != NULL) {
BKE_displist_free(&ltOb->curve_cache->disp);
}
copy_m4_m4(mat, ltOb->obmat);
unit_m4(ltOb->obmat);