From 2afed4c272155c50f11e523d050c16b200266f62 Mon Sep 17 00:00:00 2001 From: Duncan Date: Mon, 3 Apr 2023 09:27:19 +0100 Subject: [PATCH] Fix #19803. Crash when invalid scenery element for sign --- src/openrct2-ui/windows/Sign.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/openrct2-ui/windows/Sign.cpp b/src/openrct2-ui/windows/Sign.cpp index 036b9f4be0..957d78707d 100644 --- a/src/openrct2-ui/windows/Sign.cpp +++ b/src/openrct2-ui/windows/Sign.cpp @@ -250,7 +250,10 @@ public: main_colour_btn->type = WindowWidgetType::Empty; text_colour_btn->type = WindowWidgetType::Empty; - + if (wallEntry == nullptr) + { + return; + } if (wallEntry->flags & WALL_SCENERY_HAS_PRIMARY_COLOUR) { main_colour_btn->type = WindowWidgetType::ColourBtn; @@ -266,7 +269,10 @@ public: main_colour_btn->type = WindowWidgetType::Empty; text_colour_btn->type = WindowWidgetType::Empty; - + if (sceneryEntry == nullptr) + { + return; + } if (sceneryEntry->flags & LARGE_SCENERY_FLAG_HAS_PRIMARY_COLOUR) { main_colour_btn->type = WindowWidgetType::ColourBtn;