diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/TrackDetailsMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/TrackDetailsMenu.java index 257864d3ff..ec2ee5f22f 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/TrackDetailsMenu.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/TrackDetailsMenu.java @@ -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()); } diff --git a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java index 2d889eef05..05c658efe4 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java @@ -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());