possible fix for crash when grabbing bubblewand

This commit is contained in:
Seth Alves 2015-12-08 09:44:43 -08:00
parent 0bf276efa5
commit ec9f1e0754

View file

@ -206,10 +206,13 @@ QUuid EntityScriptingInterface::editEntity(QUuid id, const EntityItemProperties&
// All of parentID, parentJointIndex, position, rotation are needed to make sense of any of them. // All of parentID, parentJointIndex, position, rotation are needed to make sense of any of them.
// If any of these changed, pull any missing properties from the entity. // If any of these changed, pull any missing properties from the entity.
EntityItemPointer entity = _entityTree->findEntityByEntityItemID(entityID); EntityItemPointer entity = _entityTree->findEntityByEntityItemID(entityID);
if (entity && !scriptSideProperties.parentIDChanged()) { if (!entity) {
return;
}
if (!scriptSideProperties.parentIDChanged()) {
properties.setParentID(entity->getParentID()); properties.setParentID(entity->getParentID());
} }
if (entity && !scriptSideProperties.parentJointIndexChanged()) { if (!scriptSideProperties.parentJointIndexChanged()) {
properties.setParentJointIndex(entity->getParentJointIndex()); properties.setParentJointIndex(entity->getParentJointIndex());
} }
if (!scriptSideProperties.localPositionChanged() && !scriptSideProperties.positionChanged()) { if (!scriptSideProperties.localPositionChanged() && !scriptSideProperties.positionChanged()) {