Skip to content

Commit

Permalink
Merge pull request #93 from catenda/empty-objmember-pr
Browse files Browse the repository at this point in the history
Don't throw runtime error if endElement is called without a bound ele…
  • Loading branch information
jklimke authored Jul 8, 2024
2 parents ce66bf2 + 9aca70d commit da57819
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sources/src/parser/citygmlelementparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ namespace citygml {
// This might happen if an container element that usally contains a child element links to an exting object using XLink an thus
// uses a combined start/end element: e.g.: <surfaceMember xlink:href="#..."/>
// For such elements a child parser must only be created if there is no xlink attribute.
CITYGML_LOG_ERROR(m_logger, "CityGMLElementParser::endElement called on unbound " << elementParserName() << " object for element <" << node << "> at " << getDocumentLocation());
throw std::runtime_error("CityGMLElementParser::endElement called on unbound CityGMLElementParser object.");
// It can also happen in cases when a <cityObjectMember> only contains ignored elements.
CITYGML_LOG_WARN(m_logger, "CityGMLElementParser::endElement called on unbound " << elementParserName() << " object for element <" << node << "> at " << getDocumentLocation());
m_documentParser.removeCurrentElementParser(this);
return true;
}

if (m_boundElement == node) {
Expand Down

0 comments on commit da57819

Please sign in to comment.