Fixing potential access to null object

This commit is contained in:
Brad Davis 2015-09-11 12:02:57 -07:00
parent 7fecd3261d
commit fd1cfadc47

View file

@ -568,6 +568,7 @@ bool EntityScriptingInterface::actionWorker(const QUuid& entityID,
}); });
// transmit the change // transmit the change
if (success) {
EntityItemProperties properties; EntityItemProperties properties;
_entityTree->withReadLock([&] { _entityTree->withReadLock([&] {
properties = entity->getProperties(); properties = entity->getProperties();
@ -577,6 +578,7 @@ bool EntityScriptingInterface::actionWorker(const QUuid& entityID,
auto now = usecTimestampNow(); auto now = usecTimestampNow();
properties.setLastEdited(now); properties.setLastEdited(now);
queueEntityMessage(PacketType::EntityEdit, entityID, properties); queueEntityMessage(PacketType::EntityEdit, entityID, properties);
}
return success; return success;
} }