Commit: b9ae517794765d6a16604de2803145e859bafb9d
Author: Campbell Barton
Date:   Wed Mar 7 16:40:02 2018 +1100
Branches: blender2.8
https://developer.blender.org/rBb9ae517794765d6a16604de2803145e859bafb9d

Add missing NULL check

Caused loading user-prefs to crash.

===================================================================

M       source/blender/editors/scene/scene_edit.c

===================================================================

diff --git a/source/blender/editors/scene/scene_edit.c 
b/source/blender/editors/scene/scene_edit.c
index da720272f67..6298f03a6b0 100644
--- a/source/blender/editors/scene/scene_edit.c
+++ b/source/blender/editors/scene/scene_edit.c
@@ -134,7 +134,7 @@ void ED_scene_change_update(
        CTX_data_eval_ctx(C, &eval_ctx_old);
        eObjectMode object_mode_old = workspace->object_mode;
        ViewLayer *layer_old = BKE_view_layer_from_workspace_get(scene_old, 
workspace);
-       Object *obact_old = OBACT(layer_old);
+       Object *obact_old = layer_old ? OBACT(layer_old) : NULL;
        bool obact_new_mode_exists = 
ED_object_mode_generic_exists(bmain->wm.first, obact_new, 
workspace->object_mode);

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to