diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-04-08 14:03:51 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-04-08 14:03:51 +0400 |
commit | 97a6965da9a671987df50570f8206c39569bac78 (patch) | |
tree | c992ca5b83fc9531637ab7ab9fc59ae17b62685c /source/blender/editors/physics/particle_edit.c | |
parent | bb98f65112cd238a13fbbdc9143daab66d7d9daf (diff) |
fix for various crashes from incorrect poll functions.
- bevel had incorrect cancel when initialization failed which could crash (own mistake).
- main particle poll function didnt check if the area/region were NULL.
- some uv operators needed space image but didnt check for it. also use uv_ prefix for most operator functions.
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) |