don't crash if entity vanishes while doing touch test

This commit is contained in:
Seth Alves 2016-02-22 14:00:01 -08:00
parent 8a3b233659
commit c470649076

View file

@ -1589,8 +1589,11 @@ function MyController(hand) {
ids.forEach(function(id) {
var props = Entities.getEntityProperties(id, ["boundingBox", "name"]);
if (props.name === 'pointer') {
return;
} else if (props.boundingBox) {
continue;
}
if (!props || !props.boundingBox) {
continue;
}
var entityMinPoint = props.boundingBox.brn;
var entityMaxPoint = props.boundingBox.tfl;
var leftIsTouching = pointInExtents(leftHandPosition, entityMinPoint, entityMaxPoint);
@ -1612,8 +1615,6 @@ function MyController(hand) {
//we are in another state
return;
}
}
});
};