The Bop music player is crashing when I remove a song and click on track changer next/previous button.

in utopian-io •  6 years ago 

Project Information

Expected behavior

I expected that after removing the song it will stop to play or the player will move to another song. I think this not weird than freezing the app by taping on the next/previous button. I expected the app will run smoothly after I clicked on that button.

Actual behavior

The crash happens after I removed a playing/running song from all songs folder and clicked on the previous/next button.

How to reproduce

Steps to reproduce the behavior:

  1. Launch the app and go to "All Songs" folder.
  2. Click on a song (The song will start to play)
  3. Tap on ⋮ (Three dots/ Vertical ellipsis) and remove that song (You will notice the song is started to play again from the beginning).
  4. Then tap on music logo.
  5. Then click on next or previous button.
  6. Finally, See error.
  • App version: Bop music player v1.2
  • Operating system: Android 6.0.1

Recording Of The Bug

GitHub Account

https://github.com/sagorahmed
The submitted issue is here

Logcat Report

03-20 17:46:02.202 22305 22305 E AndroidRuntime: FATAL EXCEPTION: main

03-20 17:46:02.202 22305 22305 E AndroidRuntime: Process: com.sahdeepsingh.Bop, PID: 22305

03-20 17:46:02.202 22305 22305 E AndroidRuntime: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0

03-20 17:46:02.202 22305 22305 E AndroidRuntime:    at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)

03-20 17:46:02.202 22305 22305 E AndroidRuntime:    at java.util.ArrayList.get(ArrayList.java:308)

03-20 17:46:02.202 22305 22305 E AndroidRuntime:    at com.sahdeepsingh.Bop.services.ServicePlayMusic.h(Unknown Source)

03-20 17:46:02.202 22305 22305 E AndroidRuntime:    at com.sahdeepsingh.Bop.Activities.PlayerView.o(Unknown Source)

03-20 17:46:02.202 22305 22305 E AndroidRuntime:    at com.sahdeepsingh.Bop.Activities.PlayerView$6.onClick(Unknown Source)

03-20 17:46:02.202 22305 22305 E AndroidRuntime:    at android.view.View.performClick(View.java:5714)

03-20 17:46:02.202 22305 22305 E AndroidRuntime:    at android.view.View$PerformClick.run(View.java:22589)

03-20 17:46:02.202 22305 22305 E AndroidRuntime:    at android.os.Handler.handleCallback(Handler.java:739)

03-20 17:46:02.202 22305 22305 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:95)

03-20 17:46:02.202 22305 22305 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:148)

03-20 17:46:02.202 22305 22305 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:7325)

03-20 17:46:02.202 22305 22305 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)

03-20 17:46:02.202 22305 22305 E AndroidRuntime:    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)

03-20 17:46:02.202 22305 22305 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Hi @sagorahmed, thanks for making this contribution.

I see the issue has been resolved by the project maintainer.

My feedback

  1. Whie this bug is reproducible, your expected behavior does not conform to the expectations of that particular feature. You had no other song on the playist except for that single song, and then you removed this single song from the playlist. Now we have an empty playlist, then you still tried to play the next song ( on an empty playlist).

  2. Your expected behavior should have been - "I expected nothing to happen since the playlist was now empty" or "a message informing the user that the playist is empty".

Thanks again for the contribution :)

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Chat with us on Discord.

[utopian-moderator]

Thank you for your review, @fego! Keep up the good work!

Hi @sagorahmed!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Hey, @sagorahmed!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!