Fix possible npe and concurrent exception

This commit is contained in:
Vitaliy 2020-05-22 15:58:08 +03:00
parent 9e6826760a
commit 82c8349b3f
3 changed files with 5 additions and 7 deletions

View file

@ -1161,12 +1161,10 @@ public class MapMarkersHelper {
removeGroupActiveMarkers(group, true);
return;
}
for (FavouritePoint fp : favGroup.getPoints()) {
List<FavouritePoint> favPoints = new ArrayList<>(favGroup.getPoints());
for (FavouritePoint fp : favPoints) {
addNewMarkerIfNeeded(group, groupMarkers, new LatLon(fp.getLatitude(), fp.getLongitude()), fp.getName(), fp, null);
}
} else if (group.getType() == MapMarkersGroup.GPX_TYPE) {
GpxSelectionHelper gpxHelper = ctx.getSelectedGpxHelper();
File file = new File(group.getId());

View file

@ -132,7 +132,7 @@ public class ContributionVersionActivity extends OsmandListActivity {
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if(ACTIVITY_TO_INSTALL == requestCode && resultCode != RESULT_OK){
if (ACTIVITY_TO_INSTALL == requestCode && resultCode != RESULT_OK && currentInstalledDate != null) {
updateInstalledApp(false, currentInstalledDate);
}
}

View file

@ -393,9 +393,9 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe
canvas.translate(box.getCenterPixelX() - contextMarker.getWidth() / 2, box.getCenterPixelY() - contextMarker.getHeight());
contextMarker.draw(canvas);
}
if (this.nightMode != nightMode && currentWidgetState != null) {
if (this.nightMode != nightMode) {
this.nightMode = nightMode;
updateQuickActionButton(currentWidgetState);
updateQuickActionButton(currentWidgetState != null && currentWidgetState);
}
setupQuickActionBtnVisibility();
}