Fix #116193: Assert on selecting object in outliner.

The asserts added in b840ba1f59 revealed the bug, which was passing the
wrong Scene pointer to `BKE_view_layer_synced_ensure` in affected code.

Issue likely introduced in 68589a31ebfb79, was probably never actually a
crash-case because the viewlayer would always be in sync already when
this was called from the Outliner (besides perhaps some extremely rare
edge cases).

To be backported to potential bugfix release of 4.0 together with
b840ba1f59 commit.
This commit is contained in:
Bastien Montagne 2023-12-15 10:32:24 +01:00
parent 92cf9dd2f2
commit c23b51d614

@ -328,7 +328,7 @@ static void tree_element_object_activate(bContext *C,
}
/* find associated base in current scene */
BKE_view_layer_synced_ensure(sce, view_layer);
BKE_view_layer_synced_ensure(scene, view_layer);
base = BKE_view_layer_base_find(view_layer, ob);
if (scene->toolsettings->object_flag & SCE_OBJECT_MODE_LOCK) {