Fix potential NPE on entity targeting by non-entity