mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 08:17:11 +02:00
Fixing potential access to null object
This commit is contained in:
parent
7fecd3261d
commit
fd1cfadc47
1 changed files with 10 additions and 8 deletions
|
@ -568,15 +568,17 @@ bool EntityScriptingInterface::actionWorker(const QUuid& entityID,
|
|||
});
|
||||
|
||||
// transmit the change
|
||||
EntityItemProperties properties;
|
||||
_entityTree->withReadLock([&] {
|
||||
properties = entity->getProperties();
|
||||
});
|
||||
if (success) {
|
||||
EntityItemProperties properties;
|
||||
_entityTree->withReadLock([&] {
|
||||
properties = entity->getProperties();
|
||||
});
|
||||
|
||||
properties.setActionDataDirty();
|
||||
auto now = usecTimestampNow();
|
||||
properties.setLastEdited(now);
|
||||
queueEntityMessage(PacketType::EntityEdit, entityID, properties);
|
||||
properties.setActionDataDirty();
|
||||
auto now = usecTimestampNow();
|
||||
properties.setLastEdited(now);
|
||||
queueEntityMessage(PacketType::EntityEdit, entityID, properties);
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue