parse_xml can return nullptr

This commit is contained in:
Thomas Krijnen
2020-05-05 13:07:55 +02:00
parent 23f5c808e8
commit c9c2f76960
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -948,7 +948,7 @@ bool init_input_file(const std::string& filename, IfcParse::IfcFile*& ifc_file,
} else
#endif
ifc_file = new IfcParse::IfcFile(filename);
if (!ifc_file->good()) {
if (!ifc_file || !ifc_file->good()) {
#endif
Logger::Error("Unable to parse input file '" + filename + "'");
return false;