diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-10-18 11:46:39 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-10-18 11:46:39 +0300 |
commit | ecf20e7a5629f194abe77d9b82c8dc73f06a160f (patch) | |
tree | 579007a7f1e93837810b234194dc1ed5cbbab6dc /source/blender/windowmanager | |
parent | ec2bbc90e7c6a7f21da253333a14d49ef1428319 (diff) |
Fix crash accessing enums without a context
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_window.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 2ad90537cde..fef65d3dfc2 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -59,9 +59,9 @@ #include "BKE_screen.h" #include "BKE_workspace.h" - #include "RNA_access.h" #include "RNA_define.h" +#include "RNA_enum_types.h" #include "WM_api.h" #include "WM_types.h" @@ -883,6 +883,9 @@ int wm_window_new_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(even const EnumPropertyItem *wm_window_new_screen_itemf( bContext *C, struct PointerRNA *UNUSED(ptr), struct PropertyRNA *UNUSED(prop), bool *r_free) { + if (C == NULL) { + return DummyRNA_NULL_items; + } wmWindow *win = CTX_wm_window(C); WorkSpace *workspace = WM_window_get_active_workspace(win); ListBase *listbase = BKE_workspace_layouts_get(workspace); |