From d55534732300036ef850f8bdc4308310372bc4b8 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 18 Mar 2025 23:51:38 -0400 Subject: [PATCH] Fix crash when adding first MAPSEC define --- src/project.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/project.cpp b/src/project.cpp index 52657f90..343e732b 100644 --- a/src/project.cpp +++ b/src/project.cpp @@ -2357,7 +2357,7 @@ bool Project::addNewMapsec(const QString &idName, const QString &displayName) { return false; } - if (this->mapSectionIdNamesSaveOrder.last() == getEmptyMapsecName()) { + if (!this->mapSectionIdNamesSaveOrder.isEmpty() && this->mapSectionIdNamesSaveOrder.last() == getEmptyMapsecName()) { // If the default map section name (MAPSEC_NONE) is last in the list we'll keep it last in the list. this->mapSectionIdNamesSaveOrder.insert(this->mapSectionIdNames.length() - 1, idName); } else {