diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-01-31 07:54:51 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-01-31 07:54:51 +0400 |
commit | 528e001121ae89e3f22d783857abf3ed2072b3c4 (patch) | |
tree | d4759db40e454daf6e55964f1a7d6ffc76574d92 /source | |
parent | 101a287040cf7e93ea27f31dca9d408e0d4a3c62 (diff) |
fix [#30025] Blender crash when using python to load a blend file and import an obj file
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesrna/intern/rna_material.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 8794914e727..21b9c830435 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -93,10 +93,14 @@ static void rna_Material_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *p Material *ma= ptr->id.data; DAG_id_tag_update(&ma->id, 0); - if(scene->gm.matmode == GAME_MAT_GLSL) - WM_main_add_notifier(NC_MATERIAL|ND_SHADING_DRAW, ma); - else - WM_main_add_notifier(NC_MATERIAL|ND_SHADING, ma); + if (scene) { /* can be NULL, see [#30025] */ + if (scene->gm.matmode == GAME_MAT_GLSL) { + WM_main_add_notifier(NC_MATERIAL|ND_SHADING_DRAW, ma); + } + else { + WM_main_add_notifier(NC_MATERIAL|ND_SHADING, ma); + } + } } static void rna_Material_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) |