mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-06 12:23:09 +02: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) {
|
if (!bestFitBefore && bestFitAfter) {
|
||||||
// This is the case where the entity existed, and is in some element in our tree...
|
// This is the case where the entity existed, and is in some element in our tree...
|
||||||
if (currentContainingElement.get() != this) {
|
if (currentContainingElement.get() != this) {
|
||||||
|
// if the currentContainingElement is non-null, remove the entity from it
|
||||||
|
if (currentContainingElement) {
|
||||||
currentContainingElement->removeEntityItem(entityItem);
|
currentContainingElement->removeEntityItem(entityItem);
|
||||||
|
}
|
||||||
addEntityItem(entityItem);
|
addEntityItem(entityItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue