fixing error handling NPE when location information is not found