mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 03:06:29 +00:00
Report and tolerate XML GUI object setting errors when parsing XML attribute strings as values for settings that don't exist on the GUI object.
Followinge326ebae46,80b1876b77,d6db5a466d, ... the XML errors were silently ignored. Following1a49ccb294it led to a crash (m_Setting access for an item that does not exist). Differential Revision: https://code.wildfiregames.com/D2297 Tested on: clang 8.0.1, Jenkins This was SVN commit r22911.
This commit is contained in:
+1
-5
@@ -715,11 +715,7 @@ void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec
|
||||
if (attr.Name == attr_z)
|
||||
ManuallySetZ = true;
|
||||
|
||||
const CStr settingName = pFile->GetAttributeString(attr.Name);
|
||||
if (object->SettingExists(settingName))
|
||||
object->SetSettingFromString(settingName, attr.Value.FromUTF8(), false);
|
||||
else
|
||||
LOGERROR("GUI: (object: %s) Can't set \"%s\" to \"%s\"", object->GetPresentableName(), settingName, attr.Value);
|
||||
object->SetSettingFromString(pFile->GetAttributeString(attr.Name), attr.Value.FromUTF8(), false);
|
||||
}
|
||||
|
||||
// Check if name isn't set, generate an internal name in that case.
|
||||
|
||||
Reference in New Issue
Block a user