Skip to content

Commit

Permalink
Fix NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
andreynovikov committed Feb 22, 2024
1 parent 8255593 commit 9c6accd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,9 @@ private void processTrackPoint(Track.TrackPoint point) {
private final Observer<Track> trackObserver = new Observer<Track>() {
@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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 9c6accd

Please sign in to comment.