From 51a43e2eeefe18ebd3689c2f1727e0ff09e65d29 Mon Sep 17 00:00:00 2001 From: Jan Orend <56254096+3dJan@users.noreply.github.com> Date: Mon, 8 Apr 2024 11:07:00 +0200 Subject: [PATCH] Fix null pointer exception in CMeshObject::GetVolumeData() --- Source/API/lib3mf_meshobject.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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())); }