Merge pull request #12918 from kitely/fix-addentity-failure

Fixed null pointer exception if importing an entity from JSON fails
This commit is contained in:
Seth Alves 2018-04-21 18:12:48 -07:00 committed by GitHub
commit 9e1bd69af3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2285,7 +2285,10 @@ bool EntityTree::sendEntitiesOperation(const OctreeElementPointer& element, void
if (args->otherTree) {
args->otherTree->withWriteLock([&] {
EntityItemPointer entity = args->otherTree->addEntity(newID, properties);
entity->deserializeActions();
if (entity) {
entity->deserializeActions();
}
// else: there was an error adding this entity
});
}
return newID;