diff --git a/python/collision-geometries.cc b/python/collision-geometries.cc index 14ee334a5ef780786446781feb6c547307f8d225..45c1cf39a9e9cdf3cb58a1ac919a4c9772259a92 100644 --- a/python/collision-geometries.cc +++ b/python/collision-geometries.cc @@ -87,7 +87,10 @@ struct BVHModelBaseWrapper { } static RefRowMatrixX3 vertices(BVHModelBase& bvh) { - return MapRowMatrixX3((*(bvh.vertices))[0].data(), bvh.num_vertices, 3); + if (bvh.num_vertices > 0) + return MapRowMatrixX3(bvh.vertices->data()->data(), bvh.num_vertices, 3); + else + return MapRowMatrixX3(NULL, bvh.num_vertices, 3); } static Triangle tri_indices(const BVHModelBase& bvh, unsigned int i) {