From cfc2c1373dcba75371b1e76e0668e61197f120da Mon Sep 17 00:00:00 2001 From: Shaolin Date: Tue, 27 Feb 2018 22:42:23 -0300 Subject: [PATCH] UI: Check if source is valid earlier --- UI/window-basic-main.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 7ac5df1e4..74e892ce7 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -5679,14 +5679,13 @@ void OBSBasic::OpenSourceWindow() { int monitor = sender()->property("monitor").toInt(); OBSSceneItem item = GetCurrentSceneItem(); - OBSSource source = obs_sceneitem_get_source(item); - QString text = QString::fromUtf8(obs_source_get_name(source)); - - QString title = QTStr("SourceWindow") + " - " + text; - if (!item) return; + OBSSource source = obs_sceneitem_get_source(item); + QString text = QString::fromUtf8(obs_source_get_name(source)); + QString title = QTStr("SourceWindow") + " - " + text; + OpenProjector(obs_sceneitem_get_source(item), monitor, true, title); } @@ -5701,14 +5700,13 @@ void OBSBasic::OpenSceneWindow() { int monitor = sender()->property("monitor").toInt(); OBSScene scene = GetCurrentScene(); - OBSSource source = obs_scene_get_source(scene); - QString text = QString::fromUtf8(obs_source_get_name(source)); - - QString title = QTStr("SceneWindow") + " - " + text; - if (!scene) return; + OBSSource source = obs_scene_get_source(scene); + QString text = QString::fromUtf8(obs_source_get_name(source)); + QString title = QTStr("SceneWindow") + " - " + text; + OpenProjector(obs_scene_get_source(scene), monitor, true, title); }