mirror of
https://github.com/lubosz/overte.git
synced 2025-04-23 20:34:07 +02:00
Fix potential nullptr access in EntityTreeElement
This commit is contained in:
parent
160756145b
commit
43ec898c87
1 changed files with 4 additions and 1 deletions
|
@ -1001,7 +1001,10 @@ int EntityTreeElement::readElementDataFromBuffer(const unsigned char* data, int
|
|||
if (!bestFitBefore && bestFitAfter) {
|
||||
// This is the case where the entity existed, and is in some element in our tree...
|
||||
if (currentContainingElement.get() != this) {
|
||||
currentContainingElement->removeEntityItem(entityItem);
|
||||
// if the currentContainingElement is non-null, remove the entity from it
|
||||
if (currentContainingElement) {
|
||||
currentContainingElement->removeEntityItem(entityItem);
|
||||
}
|
||||
addEntityItem(entityItem);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue