Add missing NULL check

Caused loading user-prefs to crash.
This commit is contained in:
Campbell Barton 2018-03-07 16:40:02 +11:00
parent 49baf15a35
commit b9ae517794
Notes: blender-bot 2023-02-14 08:38:14 +01:00
Referenced by commit 8851460174, Proper fix for User Preferences window crash
1 changed files with 1 additions and 1 deletions

View File

@ -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);