From b0671c76d87dbc0bed0341979f33a07c28329396 Mon Sep 17 00:00:00 2001 From: Alexei Kotov Date: Sat, 22 Jun 2024 12:39:59 +0300 Subject: [PATCH] Throw on setting tags that can't provide the setting name --- apps/openmw/mwgui/windowmanagerimp.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp index 3212e8f02b..012c19275c 100644 --- a/apps/openmw/mwgui/windowmanagerimp.cpp +++ b/apps/openmw/mwgui/windowmanagerimp.cpp @@ -1097,6 +1097,9 @@ namespace MWGui { tag = tag.substr(MyGuiPrefix.length()); size_t comma_pos = tag.find(','); + if (comma_pos == std::string_view::npos) + throw std::runtime_error("Invalid setting tag (expected comma): " + std::string(tag)); + std::string_view settingSection = tag.substr(0, comma_pos); std::string_view settingTag = tag.substr(comma_pos + 1, tag.length());