mirror of
https://github.com/lubosz/overte.git
synced 2025-08-08 02:48:12 +02:00
Add null check to entity render clearing to fix crash.
Co-Authored-By: null <HifiExperiments@users.noreply.github.com>
This commit is contained in:
parent
079c0c022e
commit
94c230b78b
1 changed files with 2 additions and 2 deletions
|
@ -248,7 +248,7 @@ void EntityTreeRenderer::clearDomainAndNonOwnedEntities() {
|
||||||
for (const auto& entry : _entitiesInScene) {
|
for (const auto& entry : _entitiesInScene) {
|
||||||
const auto& renderer = entry.second;
|
const auto& renderer = entry.second;
|
||||||
const EntityItemPointer& entityItem = renderer->getEntity();
|
const EntityItemPointer& entityItem = renderer->getEntity();
|
||||||
if (!(entityItem->isLocalEntity() || entityItem->isMyAvatarEntity())) {
|
if (entityItem && !(entityItem->isLocalEntity() || entityItem->isMyAvatarEntity())) {
|
||||||
fadeOutRenderable(renderer);
|
fadeOutRenderable(renderer);
|
||||||
} else {
|
} else {
|
||||||
savedEntities[entry.first] = entry.second;
|
savedEntities[entry.first] = entry.second;
|
||||||
|
@ -682,7 +682,7 @@ void EntityTreeRenderer::leaveDomainAndNonOwnedEntities() {
|
||||||
QSet<EntityItemID> currentEntitiesInsideToSave;
|
QSet<EntityItemID> currentEntitiesInsideToSave;
|
||||||
foreach (const EntityItemID& entityID, _currentEntitiesInside) {
|
foreach (const EntityItemID& entityID, _currentEntitiesInside) {
|
||||||
EntityItemPointer entityItem = getTree()->findEntityByEntityItemID(entityID);
|
EntityItemPointer entityItem = getTree()->findEntityByEntityItemID(entityID);
|
||||||
if (!(entityItem->isLocalEntity() || entityItem->isMyAvatarEntity())) {
|
if (entityItem && !(entityItem->isLocalEntity() || entityItem->isMyAvatarEntity())) {
|
||||||
emit leaveEntity(entityID);
|
emit leaveEntity(entityID);
|
||||||
if (_entitiesScriptEngine) {
|
if (_entitiesScriptEngine) {
|
||||||
_entitiesScriptEngine->callEntityScriptMethod(entityID, "leaveEntity");
|
_entitiesScriptEngine->callEntityScriptMethod(entityID, "leaveEntity");
|
||||||
|
|
Loading…
Reference in a new issue