diff options
Diffstat (limited to 'source/blender/python/intern/bpy_interface.c')
-rw-r--r-- | source/blender/python/intern/bpy_interface.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 2fcb36f6d5b..2c1edc965e9 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -698,8 +698,13 @@ int BPY_button_eval(bContext *C, char *expr, double *value) void BPY_load_user_modules(bContext *C) { PyGILState_STATE gilstate; + Main *bmain= CTX_data_main(C); Text *text; + /* can happen on file load */ + if(bmain==NULL) + return; + bpy_context_set(C, &gilstate); for(text=CTX_data_main(C)->text.first; text; text= text->id.next) { |