Skip to content

Commit

Permalink
Protect against providers being null
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpoole committed Oct 13, 2024
1 parent a42ca39 commit 5b3d889
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/java/de/blau/android/resources/TileLayerSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -1275,9 +1275,11 @@ public Collection<String> getAttributions(final int zoom, @NonNull final Boundin
public Collection<Provider> getProviders(final int zoom, @NonNull final BoundingBox area) {
checkMetaData();
Collection<Provider> ret = new ArrayList<>();
for (Provider p : providers) {
if (p.getAttribution() != null && p.covers(Math.min(zoom, getMaxZoom()), area)) { // ignore overzoom
ret.add(p);
if (providers != null) {
for (Provider p : providers) {
if (p.getAttribution() != null && p.covers(Math.min(zoom, getMaxZoom()), area)) { // ignore overzoom
ret.add(p);
}
}
}
return ret;
Expand Down

0 comments on commit 5b3d889

Please sign in to comment.