diff options
-rw-r--r-- | source/blender/makesrna/intern/rna_sculpt_paint.c | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_keymap.c | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index 5aa4fa81076..e0687295c70 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -236,7 +236,7 @@ static void rna_Sculpt_ShowDiffuseColor_update(Main *UNUSED(bmain), Scene *scene { Object *ob = (scene->basact) ? scene->basact->object : NULL; - if (ob) { + if (ob && ob->sculpt) { Sculpt *sd = scene->toolsettings->sculpt; ob->sculpt->show_diffuse_color = sd->flags & SCULPT_SHOW_DIFFUSE; diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index 3739462ac2c..a296c742e5c 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -126,10 +126,13 @@ static int wm_keymap_item_equals(wmKeyMapItem *a, wmKeyMapItem *b) /* properties can be NULL, otherwise the arg passed is used and ownership is given to the kmi */ void WM_keymap_properties_reset(wmKeyMapItem *kmi, struct IDProperty *properties) { - WM_operator_properties_free(kmi->ptr); - MEM_freeN(kmi->ptr); + if (LIKELY(kmi->ptr)) { + WM_operator_properties_free(kmi->ptr); + MEM_freeN(kmi->ptr); + + kmi->ptr = NULL; + } - kmi->ptr = NULL; kmi->properties = properties; wm_keymap_item_properties_set(kmi); |