Fixed a potential crash for legacy themes with broken configuration.

This commit is contained in:
Leon Styhre 2022-02-09 23:12:12 +01:00
parent bdbc0580d2
commit 70eb937f85

View file

@ -1182,9 +1182,11 @@ void ThemeData::parseElement(const pugi::xml_node& root,
case BOOLEAN: { case BOOLEAN: {
bool boolVal = false; bool boolVal = false;
// Only look at the first character. // Only look at the first character.
if (str.size() > 0) {
if (str.front() == '1' || str.front() == 't' || str.front() == 'T' || if (str.front() == '1' || str.front() == 't' || str.front() == 'T' ||
str.front() == 'y' || str.front() == 'Y') str.front() == 'y' || str.front() == 'Y')
boolVal = true; boolVal = true;
}
element.properties[node.name()] = boolVal; element.properties[node.name()] = boolVal;
break; break;