1
0
Fork 0

check that the block was created before assigning parents

This commit is contained in:
Kevin Matz 2022-12-06 18:05:12 -05:00
parent 7434ac3d91
commit 26ae455a07
1 changed files with 4 additions and 2 deletions

View File

@ -208,8 +208,10 @@ public:
*/
template<class T>
void createDataBlock() {
if (!data_) { // may already have a data segment
createData<Block<T>>();
if (data_)
return; // already has a data segment
createData<Block<T>>();
if (data_) {
auto block = std::static_pointer_cast<Block<T>>(data_);
block->setParent(shared_from_this());
}