Watch out for a null pointer in location provider.