From 346d933cb7d5d2e016ce235fb4336e202ca7708e Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 21 Nov 2013 13:42:37 +0200 Subject: [PATCH] Avoid crash if an object does not have a shape --- source/3d/layout.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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(); -- 2.43.0