mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Merge pull request #11087 from jherico/crash_null_entity_element
Fix potential nullptr access in EntityTreeElement
This commit is contained in:
commit
5bdaa4daa1
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