From 3cc7dc0e7cf8b01081dc23e432115f7efd0c8877 Mon Sep 17 00:00:00 2001 From: Penwywern Date: Thu, 30 Nov 2023 20:31:34 +0100 Subject: [PATCH] UI: Fall back in case of invalid scene name on load --- UI/window-basic-main.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 01e58f75b..f8b4c5359 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -1211,6 +1211,17 @@ retryScene: goto retryScene; } + if (!curScene) { + auto find_scene_cb = [](void *source_ptr, obs_source_t *scene) { + OBSSourceAutoRelease &source = + reinterpret_cast( + source_ptr); + source = obs_source_get_ref(scene); + return false; + }; + obs_enum_scenes(find_scene_cb, &curScene); + } + SetCurrentScene(curScene.Get(), true); if (!curProgramScene)