Skip to content

Commit

Permalink
#157: fix: NPE on delayed map zoom-change while map was already desto…
Browse files Browse the repository at this point in the history
…yed (by other task)
  • Loading branch information
k3b committed Feb 6, 2020
1 parent ec98aa8 commit 9c7eb43
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -660,20 +660,23 @@ protected boolean onMarkerLongPress(MapView mapView, int markerId, IGeoPoint geo
}

private void reloadFotoMarker(String why) {
if (mIsInitialized) {
if (mIsInitialized && (mFolderOverlayGreenPhotoMarker != null)) {
// initialized
if (mCurrentFotoMarkerLoader == null) {
// not active yet
List<Overlay> oldItems = mFolderOverlayGreenPhotoMarker.getItems();

mLastZoom = this.mMapView.getZoomLevelDouble();
QueryParameter query = getCurrentAreaQuery();
if (oldItems != null) {
// #157: fix: map was not destoyed by other task
mLastZoom = this.mMapView.getZoomLevelDouble();
QueryParameter query = getCurrentAreaQuery();

if (Global.debugEnabledMap) {
Log.d(Global.LOG_CONTEXT, mDebugPrefix + "reloadFotoMarker(" + why + ")"
+ " zoom " + mLastZoom + ", query " + query);
if (Global.debugEnabledMap) {
Log.d(Global.LOG_CONTEXT, mDebugPrefix + "reloadFotoMarker(" + why + ")"
+ " zoom " + mLastZoom + ", query " + query);
}
reloadFotoMarker(query, oldItems);
}
reloadFotoMarker(query, oldItems);
} else {
// background load is already active. Remember that at least one scroll/zoom was missing
mFotoMarkerPendingLoads++;
Expand Down

0 comments on commit 9c7eb43

Please sign in to comment.