From da5a47ccc7c9a5a63e752881040205b4ff737428 Mon Sep 17 00:00:00 2001
From: Mark Moll <mmoll@rice.edu>
Date: Mon, 19 May 2014 20:10:14 -0500
Subject: [PATCH] don't compute AABBs if cgeom is a NULL pointer

---
 include/fcl/collision_object.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/include/fcl/collision_object.h b/include/fcl/collision_object.h
index f23a8984..33b0aec8 100644
--- a/include/fcl/collision_object.h
+++ b/include/fcl/collision_object.h
@@ -153,8 +153,11 @@ public:
  CollisionObject(const boost::shared_ptr<CollisionGeometry> &cgeom_) :
     cgeom(cgeom_), cgeom_const(cgeom_)
   {
-    cgeom->computeLocalAABB();
-    computeAABB();
+    if (cgeom)
+    {
+      cgeom->computeLocalAABB();
+      computeAABB();
+    }
   }
 
   CollisionObject(const boost::shared_ptr<CollisionGeometry> &cgeom_, const Transform3f& tf) :
-- 
GitLab