From 6ae0fbd45d701944e3978208aeefccdbd906b3ea Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Tue, 30 May 2017 19:33:57 +0300 Subject: [PATCH] Fix TrackSegmentFragment crash on rotate --- .../src/net/osmand/plus/myplaces/TrackSegmentFragment.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/myplaces/TrackSegmentFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/TrackSegmentFragment.java index 4cc9d884fb..c510a02409 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/TrackSegmentFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/TrackSegmentFragment.java @@ -338,11 +338,11 @@ public class TrackSegmentFragment extends OsmAndListFragment { } }); - boolean hasPath = getGpx().showCurrentTrack; + boolean hasPath = getGpx() != null && getGpx().showCurrentTrack; if (rotatedTileBox == null || mapBitmap == null || mapTrackBitmap == null) { QuadRect rect = getRect(); if (rect.left != 0 && rect.top != 0) { - hasPath = getGpx().tracks.size() > 0 || getGpx().routes.size() > 0; + hasPath = getGpx() != null && (getGpx().tracks.size() > 0 || getGpx().routes.size() > 0); progressBar.setVisibility(View.VISIBLE); double clat = rect.bottom / 2 + rect.top / 2; @@ -396,7 +396,7 @@ public class TrackSegmentFragment extends OsmAndListFragment { } if (hasPath) { - if (!getGpx().showCurrentTrack && adapter.getCount() > 0) { + if (getGpx() != null && !getGpx().showCurrentTrack && adapter.getCount() > 0) { prepareSplitIntervalAdapterData(); setupSplitIntervalView(splitIntervalView); updateSplitIntervalView(splitIntervalView);