Skip to content

Commit

Permalink
CLevelSet::GetVolumeData returns nullptr if no volumedata is set
Browse files Browse the repository at this point in the history
  • Loading branch information
3dJan committed Aug 25, 2024
1 parent 92b4cc2 commit f89ea86
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Source/API/lib3mf_levelset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit f89ea86

Please sign in to comment.