Merge pull request #3898 from JC3/patch-2

Reapply [amf] Fix crash when file could not be parsed.
pull/3842/head^2
Kim Kulling 2021-05-11 20:48:27 +02:00 committed by GitHub
commit f197e93035
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -268,7 +268,8 @@ void AMFImporter::ParseFile(const std::string &pFile, IOSystem *pIOHandler) {
mXmlParser = new XmlParser();
if (!mXmlParser->parse(file.get())) {
delete mXmlParser;
throw DeadlyImportError("Failed to create XML reader for file" + pFile + ".");
mXmlParser = nullptr;
throw DeadlyImportError("Failed to create XML reader for file ", pFile, ".");
}
// Start reading, search for root tag <amf>