Skip to content

Commit

Permalink
Protect against no imagery MRU early
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpoole committed Sep 6, 2023
1 parent 63f470d commit 5688ef9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/de/blau/android/views/layers/MapTilesLayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,10 @@ public boolean onRestoreState(@NonNull Context ctx) {
super.onRestoreState(ctx);
synchronized (getLastServers()) {
MRUList<String> tempLastServers = mruSavingHelper.load(ctx, getClass().getName() + "lastServers", true);
if (tempLastServers == null) {
Log.w(DEBUG_TAG, "No MRU");
return false;
}
Log.d(DEBUG_TAG, "read MRU size " + tempLastServers.size());
getLastServers().ensureCapacity(MRU_SIZE);
getLastServers().pushAll(tempLastServers);
Expand Down

0 comments on commit 5688ef9

Please sign in to comment.