diff options
Diffstat (limited to 'source/blender/editors/physics/particle_edit.c')
-rw-r--r-- | source/blender/editors/physics/particle_edit.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index f00295a9033..4825416f6e9 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -132,8 +132,12 @@ int PE_hair_poll(bContext *C) int PE_poll_view3d(bContext *C) { - return PE_poll(C) && CTX_wm_area(C)->spacetype == SPACE_VIEW3D && - CTX_wm_region(C)->regiontype == RGN_TYPE_WINDOW; + ScrArea *sa = CTX_wm_area(C); + ARegion *ar = CTX_wm_region(C); + + return (PE_poll(C) && + (sa && sa->spacetype == SPACE_VIEW3D) && + (ar && ar->regiontype == RGN_TYPE_WINDOW)); } void PE_free_ptcache_edit(PTCacheEdit *edit) |