Fix crashing if location is not null when opening detail view

This commit is contained in:
PavelRatushny 2017-06-28 13:01:20 +03:00
parent c720eafa46
commit d763981229

View file

@ -299,6 +299,13 @@ public class TrackDetailsMenu {
Highlight[] highlights = chart.getHighlighted();
LatLon location = null;
if (trackChartPoints == null) {
trackChartPoints = new TrackChartPoints();
int segmentColor = getTrackSegment(chart).getColor(0);
trackChartPoints.setSegmentColor(segmentColor);
trackChartPoints.setGpx(getGpxItem().group.getGpx());
}
float minimumVisibleXValue = chart.getLowestVisibleX();
float maximumVisibleXValue = chart.getHighestVisibleX();
@ -322,12 +329,6 @@ public class TrackDetailsMenu {
} else {
gpxItem.chartHighlightPos = -1;
}
if (trackChartPoints == null) {
trackChartPoints = new TrackChartPoints();
int segmentColor = getTrackSegment(chart).getColor(0);
trackChartPoints.setSegmentColor(segmentColor);
trackChartPoints.setGpx(getGpxItem().group.getGpx());
}
trackChartPoints.setXAxisPoints(getXAxisPoints(chart));
if (gpxItem.route) {
mapActivity.getMapLayers().getMapInfoLayer().setTrackChartPoints(trackChartPoints);