From a02b189f69fe0f28bbc8e84e2cc27fc008c563b1 Mon Sep 17 00:00:00 2001 From: Balleux Benjamin Date: Wed, 12 Apr 2017 16:11:37 +0200 Subject: [PATCH] Bug Fix : the previous commit made the program crash when an object has no parent --- src/ifcconvert/IfcConvert.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ifcconvert/IfcConvert.cpp b/src/ifcconvert/IfcConvert.cpp index 3cc19786e5..cbe8caa896 100644 --- a/src/ifcconvert/IfcConvert.cpp +++ b/src/ifcconvert/IfcConvert.cpp @@ -604,8 +604,9 @@ int main(int argc, char** argv) //Debug //if (parent_object != NULL) std::cout << '\n' << "obj " << geom_object->unique_id() << " parent = " << parent_object->name() << " of type " << parent_object->type() << '\n'; //else std::cout << "No parent found : " << geom_object->unique_id() << " of type : " << geom_object->type(); - - serializer->write(static_cast*>(geom_object), parent_object); + + if (parent_object != NULL) serializer->write(static_cast*>(geom_object), parent_object); + else serializer->write(static_cast*>(geom_object)); } else {