From f89ea86b1a83b6b5e4e474f5386ae451f0c15a2d Mon Sep 17 00:00:00 2001 From: Jan Orend <56254096+3dJan@users.noreply.github.com> Date: Sun, 25 Aug 2024 16:32:24 +0200 Subject: [PATCH] CLevelSet::GetVolumeData returns nullptr if no volumedata is set --- Source/API/lib3mf_levelset.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/API/lib3mf_levelset.cpp b/Source/API/lib3mf_levelset.cpp index 61d276853..d26521846 100644 --- a/Source/API/lib3mf_levelset.cpp +++ b/Source/API/lib3mf_levelset.cpp @@ -235,7 +235,9 @@ bool CLevelSet::IsLevelSetObject() IVolumeData * CLevelSet::GetVolumeData() { NMR::PModelVolumeData pVolumeData = levelSetObject()->getVolumeData(); - if (pVolumeData == nullptr) - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDOBJECT); + if (!pVolumeData) + { + return nullptr; + } return new CVolumeData(pVolumeData); } \ No newline at end of file