From be8189b0f8c0e4817b80be505950349d70a05875 Mon Sep 17 00:00:00 2001 From: Shaolin Date: Tue, 24 Jul 2018 17:43:58 -0300 Subject: [PATCH] UI: Fix start up crash with saved projectors This fixes a crash in case the user selected the option to save projectors on exit and had multiple monitors at that time. Later on, when obs is started again if the monitor list is lower now the open projector code will return null when trying to create the saved projector. Just check if the returned projector pointer is valid before trying to restore the saved geometry. --- UI/window-basic-main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 38132cf5d..bcd300e57 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -5692,7 +5692,7 @@ void OBSBasic::OpenSavedProjectors() } } - if (!info->geometry.empty()) { + if (projector && !info->geometry.empty()) { QByteArray byteArray = QByteArray::fromBase64( QByteArray(info->geometry.c_str())); projector->restoreGeometry(byteArray);