diff --git a/Source/API/lib3mf_meshobject.cpp b/Source/API/lib3mf_meshobject.cpp index 9c08449f6..32c5dffac 100644 --- a/Source/API/lib3mf_meshobject.cpp +++ b/Source/API/lib3mf_meshobject.cpp @@ -399,6 +399,11 @@ IBeamLattice* CMeshObject::BeamLattice() IVolumeData * CMeshObject::GetVolumeData() { + auto volumeData = meshObject()->getVolumeData(); + if (!volumeData) + { + return nullptr; + } return new CVolumeData(std::dynamic_pointer_cast(meshObject()->getVolumeData())); }