vhaudiquet / blade-player

Android music player that plays from local library, Spotify or Deezer
GNU General Public License v3.0
67 stars 12 forks source link

The app crashed when I tried to play an ended song again after deleting its local library path. #39

Open sagorahmed opened 5 years ago

sagorahmed commented 5 years ago

Expected behavior

I expected that the player would not crash after deleting a running song's library path and pressing the play button at the end of that song.

Actual behavior

When I tried to play again an ended song after deleting that song's library path from artist/album folder, then, unfortunately, it crashed.

How to reproduce

  1. Open the app.
  2. Go to "Artists/Albums" folder.
  3. Choose and play a song from "Artists/Albums" folder.
  4. Then click on ⋮ (Three dots/ Vertical ellipsis) at the right side of that song and click on "Manage libraries"
  5. Click on the right side of the "Local" and then press "YES" to delete it, then press ok.
  6. Tap on the song name at the bottom of your display (The playing song will appear on your display).
  7. Move forward your song to finish it.
  8. When your running song will end, then try to play that again and notice the bug.

Recording Of The Bug

blade

LogCat

04-22 18:44:11.831 12515 12515 E AndroidRuntime: FATAL EXCEPTION: main

04-22 18:44:11.831 12515 12515 E AndroidRuntime: Process: v.blade, PID: 12515

04-22 18:44:11.831 12515 12515 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'v.blade.library.sources.Source v.blade.library.SongSources$SongSource.getSource()' on a null object reference

04-22 18:44:11.831 12515 12515 E AndroidRuntime:    at v.blade.player.PlayerMediaPlayer.playSong(PlayerMediaPlayer.java:252)

04-22 18:44:11.831 12515 12515 E AndroidRuntime:    at v.blade.player.PlayerService$2.onSkipToPrevious(PlayerService.java:167)

04-22 18:44:11.831 12515 12515 E AndroidRuntime:    at android.support.v4.media.session.MediaSessionCompat$Callback$StubApi21.onSkipToPrevious(MediaSessionCompat.java:1289)

04-22 18:44:11.831 12515 12515 E AndroidRuntime:    at android.support.v4.media.session.MediaSessionCompatApi21$CallbackProxy.onSkipToPrevious(MediaSessionCompatApi21.java:224)

04-22 18:44:11.831 12515 12515 E AndroidRuntime:    at android.media.session.MediaSession$CallbackMessageHandler.handleMessage(MediaSession.java:1231)

04-22 18:44:11.831 12515 12515 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:102)

04-22 18:44:11.831 12515 12515 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:148)

04-22 18:44:11.831 12515 12515 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:7325)

04-22 18:44:11.831 12515 12515 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)

04-22 18:44:11.831 12515 12515 E AndroidRuntime:    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)

04-22 18:44:11.831 12515 12515 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)