mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 17:57:02 +00:00
parse_xml can return nullptr
This commit is contained in:
@@ -948,7 +948,7 @@ bool init_input_file(const std::string& filename, IfcParse::IfcFile*& ifc_file,
|
|||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
ifc_file = new IfcParse::IfcFile(filename);
|
ifc_file = new IfcParse::IfcFile(filename);
|
||||||
if (!ifc_file->good()) {
|
if (!ifc_file || !ifc_file->good()) {
|
||||||
#endif
|
#endif
|
||||||
Logger::Error("Unable to parse input file '" + filename + "'");
|
Logger::Error("Unable to parse input file '" + filename + "'");
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -634,8 +634,10 @@ IFC_PARSE_API IfcParse::IfcFile* IfcParse::parse_ifcxml(const std::string& filen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
state.file->parsing_complete() = true;
|
if (state.file) {
|
||||||
state.file->build_inverses();
|
state.file->parsing_complete() = true;
|
||||||
|
state.file->build_inverses();
|
||||||
|
}
|
||||||
|
|
||||||
return state.file;
|
return state.file;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user