From: Mikko Rasa Date: Thu, 21 Nov 2013 11:42:37 +0000 (+0200) Subject: Avoid crash if an object does not have a shape X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=346d933cb7d5d2e016ce235fb4336e202ca7708e;p=r2c2.git Avoid crash if an object does not have a shape --- diff --git a/source/3d/layout.cpp b/source/3d/layout.cpp index 59a23c9..be19b00 100644 --- a/source/3d/layout.cpp +++ b/source/3d/layout.cpp @@ -41,7 +41,11 @@ void Layout3D::get_bounds(Vector &minp, Vector &maxp) const Geometry::BoundingBox bbox; for(ObjectMap::const_iterator i=objects.begin(); i!=objects.end(); ++i) - bbox = bbox|i->second->get_object().get_type().get_shape()->get_axis_aligned_bounding_box(); + { + const Shape *shape = i->second->get_object().get_shape(); + if(shape) + bbox = bbox|shape->get_axis_aligned_bounding_box(); + } minp = bbox.get_minimum_point(); maxp = bbox.get_maximum_point();