From 70eb937f85d813de3e91a22adb8d6d1a8f04f33c Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Wed, 9 Feb 2022 23:12:12 +0100 Subject: [PATCH] Fixed a potential crash for legacy themes with broken configuration. --- es-core/src/ThemeData.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/es-core/src/ThemeData.cpp b/es-core/src/ThemeData.cpp index 07819e888..cfc0164c3 100644 --- a/es-core/src/ThemeData.cpp +++ b/es-core/src/ThemeData.cpp @@ -1182,9 +1182,11 @@ void ThemeData::parseElement(const pugi::xml_node& root, case BOOLEAN: { bool boolVal = false; // Only look at the first character. - if (str.front() == '1' || str.front() == 't' || str.front() == 'T' || - str.front() == 'y' || str.front() == 'Y') - boolVal = true; + if (str.size() > 0) { + if (str.front() == '1' || str.front() == 't' || str.front() == 'T' || + str.front() == 'y' || str.front() == 'Y') + boolVal = true; + } element.properties[node.name()] = boolVal; break;