From 68aad14a27fdecf0960c0ac181f8e8758b37b2b6 Mon Sep 17 00:00:00 2001 From: FlufflesTheMicrosaur Date: Thu, 20 Nov 2025 23:38:21 -0800 Subject: [PATCH] fix: 105014: fix a ctd that happens when m_pDisplay is null due to an empty dockscreen (Eventually inherited dockscreens should inherit the display data) --- Transcendence/Transcendence/CDockScreen.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Transcendence/Transcendence/CDockScreen.cpp b/Transcendence/Transcendence/CDockScreen.cpp index cd2911296..cd399aead 100644 --- a/Transcendence/Transcendence/CDockScreen.cpp +++ b/Transcendence/Transcendence/CDockScreen.cpp @@ -1088,6 +1088,18 @@ void CDockScreen::HandleKeyDown (int iVirtKey) else { + + // If the screen is null, create a blank screen and log an error + // This prevents crashing, and enables the user to escape the broken screen + + if (m_pDisplay == NULL) + { + m_pDisplay = IDockScreenDisplay::Create(*this, NULL_STR); + ReportError(CONSTLIT("Error, no display defined in this dockscreen.")); + } + + // Continue handling as normal + IDockScreenDisplay::EResults iResult = m_pDisplay->HandleKeyDown(iVirtKey); switch (iResult)