From 9d3d6da7d386fe0014b7b95e0853c00e43efec4c Mon Sep 17 00:00:00 2001 From: Qrox Date: Wed, 15 May 2024 01:00:15 +0800 Subject: [PATCH] Fix crash when opening construction menu with no visible entries --- src/construction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/construction.cpp b/src/construction.cpp index 15de3e1c8f564..2cb4ff54d096d 100644 --- a/src/construction.cpp +++ b/src/construction.cpp @@ -952,7 +952,7 @@ construction_id construction_menu( const bool blueprint ) if( select < 0 || static_cast( select ) >= constructs.size() || con_preview_group != constructs[select] ) { - con_preview_group = ( select >= 0 || static_cast( select ) < constructs.size() ) + con_preview_group = ( select >= 0 && static_cast( select ) < constructs.size() ) ? constructs[select] : construction_group_str_id::NULL_ID(); if( con_preview_group.is_null() ) { con_preview.clear();