Skip to content

Commit 7b8f054

Browse files
committed
Added an assert to the ValueIter constructor to check if the Node ptr is valid
Signed-off-by: Nick Avramoussis <[email protected]>
1 parent 8b7c521 commit 7b8f054

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

openvdb/openvdb/tree/LeafNode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ class LeafNode
229229
// Unlike other value iterators, cache the buffer data as part of
230230
// the iterators members to avoid the cost of going through the
231231
// leaf buffer atomic/checking API
232-
, mData(parent->buffer().data()) {}
232+
, mData([&]() { OPENVDB_ASSERT(parent); return parent->buffer().data(); }()) {}
233233

234234
ValueT& getItem(Index pos) const { return mData[pos]; }
235235
ValueT& getValue() const { return this->getItem(this->pos()); }

0 commit comments

Comments
 (0)