Skip to content

Commit 1dc4bb6

Browse files
committed
Fix the segmentation fault - destructor delete nullptr child
1 parent fcb67ae commit 1dc4bb6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/patterns/structural/Composite.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,8 @@ namespace
367367
// Delete folder should delete all children
368368
for (FileSystem *f : _children)
369369
{
370-
delete f;
370+
if (f != nullptr)
371+
delete f;
371372
}
372373
}
373374

0 commit comments

Comments
 (0)