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); removeGroupActiveMarkers(group, true);
return; return;
} }
List<FavouritePoint> favPoints = new ArrayList<>(favGroup.getPoints());
for (FavouritePoint fp : favGroup.getPoints()) { for (FavouritePoint fp : favPoints) {
addNewMarkerIfNeeded(group, groupMarkers, new LatLon(fp.getLatitude(), fp.getLongitude()), fp.getName(), fp, null); addNewMarkerIfNeeded(group, groupMarkers, new LatLon(fp.getLatitude(), fp.getLongitude()), fp.getName(), fp, null);
} }
} else if (group.getType() == MapMarkersGroup.GPX_TYPE) { } else if (group.getType() == MapMarkersGroup.GPX_TYPE) {
GpxSelectionHelper gpxHelper = ctx.getSelectedGpxHelper(); GpxSelectionHelper gpxHelper = ctx.getSelectedGpxHelper();
File file = new File(group.getId()); File file = new File(group.getId());

View file

@ -132,7 +132,7 @@ public class ContributionVersionActivity extends OsmandListActivity {
@Override @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) { protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, 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); 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()); canvas.translate(box.getCenterPixelX() - contextMarker.getWidth() / 2, box.getCenterPixelY() - contextMarker.getHeight());
contextMarker.draw(canvas); contextMarker.draw(canvas);
} }
if (this.nightMode != nightMode && currentWidgetState != null) { if (this.nightMode != nightMode) {
this.nightMode = nightMode; this.nightMode = nightMode;
updateQuickActionButton(currentWidgetState); updateQuickActionButton(currentWidgetState != null && currentWidgetState);
} }
setupQuickActionBtnVisibility(); setupQuickActionBtnVisibility();
} }