diff --git a/app/src/main/java/mobi/maptrek/fragments/TrackInformation.java b/app/src/main/java/mobi/maptrek/fragments/TrackInformation.java index b6941746..1fb0f056 100644 --- a/app/src/main/java/mobi/maptrek/fragments/TrackInformation.java +++ b/app/src/main/java/mobi/maptrek/fragments/TrackInformation.java @@ -343,6 +343,9 @@ private void processTrackPoint(Track.TrackPoint point) { private final Observer trackObserver = new Observer() { @Override public void onChanged(Track track) { + if (track == null) + return; + viewBinding.name.setText(track.name); if (track.source == null || track.source.isNativeTrack()) { viewBinding.sourceRow.setVisibility(View.GONE); diff --git a/app/src/main/java/mobi/maptrek/location/NavigationService.java b/app/src/main/java/mobi/maptrek/location/NavigationService.java index 3c65a390..f3ee69eb 100644 --- a/app/src/main/java/mobi/maptrek/location/NavigationService.java +++ b/app/src/main/java/mobi/maptrek/location/NavigationService.java @@ -195,7 +195,7 @@ public int onStartCommand(Intent intent, int flags, int startId) { Configuration.setNavigationPoint(navPoint); stopSelf(); } - if (action.equals(ENABLE_BACKGROUND_NAVIGATION)) { + if (action.equals(ENABLE_BACKGROUND_NAVIGATION) && navPoint != null) { mForeground = true; if (Build.VERSION.SDK_INT < 34) startForeground(NOTIFICATION_ID, getNotification(true));