Skip to content

Commit

Permalink
Check LS pointer against nullptr before usage in lsExpand (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
quell-m authored Oct 22, 2021
1 parent a7e8d25 commit a845b2c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions include/lsExpand.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@ template <class T, int D> class lsExpand {

/// Apply the expansion to the specified width
void apply() {
if (width <= levelSet->getLevelSetWidth())
return;

if (levelSet == nullptr) {
lsMessage::getInstance()
.addWarning("No level set passed to lsExpand. Not expanding.")
.print();
return;
}

if (levelSet->getNumberOfPoints() == 0) {
if (width <= levelSet->getLevelSetWidth())
return;

if (levelSet->getNumberOfPoints() == 0)
return;
}

const T totalLimit = width * 0.5;
const int startWidth = levelSet->getLevelSetWidth();
Expand Down

0 comments on commit a845b2c

Please sign in to comment.