Fix T72235: crash entering particle editmode with non-valid PTCacheEdit psys pointer
authorPhilipp Oeser <info@graphics-engineer.com>
Wed, 8 Jan 2020 12:11:18 +0000 (13:11 +0100)
committerPhilipp Oeser <info@graphics-engineer.com>
Wed, 8 Jan 2020 12:33:46 +0000 (13:33 +0100)
Caused by own rBe02ecd599bdc.
Can happen with e.g. cloth.

Also fixes T59583

Maniphest Tasks: T72235, T59583

Differential Revision: https://developer.blender.org/D6547

source/blender/editors/physics/particle_edit.c

index 9d3388bd220c580188fe894bc06f33ffabbb3cd8..120c4929ecf2debf4369a9d1fbe98daa97cffd7a 100644 (file)
@@ -1597,7 +1597,7 @@ void PE_update_object(Depsgraph *depsgraph, Scene *scene, Object *ob, int usefla
   /* Only do this for emitter particles because drawing PE_FADE_TIME is not respected in 2.8 yet
    * and flagging with PEK_HIDE will prevent selection. This might get restored once this is
    * supported in drawing (but doesn't make much sense for hair anyways). */
-  if (edit->psys->part->type == PART_EMITTER) {
+  if (edit->psys && edit->psys->part->type == PART_EMITTER) {
     PE_hide_keys_time(scene, edit, CFRA);
   }