diff --git a/OsmAnd/src/net/osmand/plus/myplaces/SplitSegmentFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/SplitSegmentFragment.java index 231e4ef379..5a39560aeb 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/SplitSegmentFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/SplitSegmentFragment.java @@ -322,29 +322,28 @@ public class SplitSegmentFragment extends OsmAndListFragment { } private List filterGroups(boolean useDisplayGroups) { - if (getTrackActivity() == null) { - return null; - } - List result = getTrackActivity().getGpxFile(useDisplayGroups); List groups = new ArrayList<>(); - for (GpxDisplayGroup group : result) { - boolean add = hasFilterType(group.getType()); - if (isArgumentTrue(ARG_TO_FILTER_SHORT_TRACKS)) { - Iterator item = group.getModifiableList().iterator(); - while (item.hasNext()) { - GpxDisplayItem it2 = item.next(); - if (it2.analysis != null && it2.analysis.totalDistance < 100) { - item.remove(); + if (getTrackActivity() != null) { + List result = getTrackActivity().getGpxFile(useDisplayGroups); + for (GpxDisplayGroup group : result) { + boolean add = hasFilterType(group.getType()); + if (isArgumentTrue(ARG_TO_FILTER_SHORT_TRACKS)) { + Iterator item = group.getModifiableList().iterator(); + while (item.hasNext()) { + GpxDisplayItem it2 = item.next(); + if (it2.analysis != null && it2.analysis.totalDistance < 100) { + item.remove(); + } + } + if (group.getModifiableList().isEmpty()) { + add = false; } } - if (group.getModifiableList().isEmpty()) { - add = false; + if (add) { + groups.add(group); } - } - if (add) { - groups.add(group); - } + } } return groups; } @@ -657,9 +656,6 @@ public class SplitSegmentFragment extends OsmAndListFragment { } if (mSelectedGpxFile != null) { List groups = getDisplayGroups(); - if (groups == null) { - return; - } mSelectedGpxFile.setDisplayGroups(groups); } updateContent(); diff --git a/OsmAnd/src/net/osmand/plus/myplaces/TrackSegmentFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/TrackSegmentFragment.java index f10023cb5a..df7be4a354 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/TrackSegmentFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/TrackSegmentFragment.java @@ -1542,9 +1542,6 @@ public class TrackSegmentFragment extends OsmAndListFragment { } if (mSelectedGpxFile != null) { List groups = getDisplayGroups(); - if (groups == null) { - return; - } mSelectedGpxFile.setDisplayGroups(groups); } if (mFragment.isVisible()) {