Skip to content
This repository has been archived by the owner on Apr 23, 2023. It is now read-only.

Commit

Permalink
Merge pull request #53 from mapzen/52-npe-fix
Browse files Browse the repository at this point in the history
Check listeners not null before iteration
  • Loading branch information
ecgreb authored Jun 15, 2016
2 parents 2652e54 + e0f338a commit 11a470f
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,11 @@ public void setMockTrace(File file) {

@Override
public void reportLocation(LocationEngine engine, Location location) {
for (LocationListener listener : engineListeners.get(engine)) {
listener.onLocationChanged(location);
List<LocationListener> listeners = engineListeners.get(engine);
if (listeners != null) {
for (LocationListener listener : listeners) {
listener.onLocationChanged(location);
}
}
}

Expand Down

0 comments on commit 11a470f

Please sign in to comment.