Added SecurityException check for location access