This commit is contained in:
Alexey Kulish 2017-07-26 12:26:28 +03:00
parent 7d19a7418a
commit 9e5dab2f75
2 changed files with 6 additions and 3 deletions

View file

@ -305,7 +305,8 @@ public class TrackDetailsMenu {
if (trackChartPoints == null) {
trackChartPoints = new TrackChartPoints();
int segmentColor = getTrackSegment(chart).getColor(0);
TrkSegment segment = getTrackSegment(chart);
int segmentColor = segment != null ? segment.getColor(0) : 0;
trackChartPoints.setSegmentColor(segmentColor);
trackChartPoints.setGpx(getGpxItem().group.getGpx());
}

View file

@ -1314,10 +1314,12 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
}
if (gpxItem.analysis.hasSpeedData) {
list.add(GPXDataSetType.SPEED);
} else {
} else if (gpxItem.analysis.hasElevationData) {
list.add(GPXDataSetType.SLOPE);
}
gpxItem.chartTypes = list.toArray(new GPXDataSetType[list.size()]);
if (list.size() > 0) {
gpxItem.chartTypes = list.toArray(new GPXDataSetType[list.size()]);
}
if (gpxItem.group.getGpx() != null) {
gpxItem.wasHidden = app.getSelectedGpxHelper().getSelectedFileByPath(gpxInfo.file.getAbsolutePath()) == null;
app.getSelectedGpxHelper().setGpxFileToDisplay(gpxItem.group.getGpx());