Fixed null pointer when location is disabled