Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash when connecting to a Bluetooth device #6570

Merged
merged 1 commit into from
Jul 3, 2021

Conversation

Redirion
Copy link
Member

@Redirion Redirion commented Jun 25, 2021

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

The last weeks and NewPipe versions I had the issue that as soon as my phone connected via BT with my car NewPipe crashed as for some reason "onCompleted" was called.

`

java.lang.NullPointerException: Attempt to invoke virtual method 'int org.schabi.newpipe.player.playqueue.PlayQueue.getIndex()' on a null object reference
org.schabi.newpipe.player.Player.onCompleted
org.schabi.newpipe.player.Player.changeState
org.schabi.newpipe.player.Player.onPlayerStateChanged

Maybe I am the only one and this is a specific issue with my current car / car software, but as we have the same null checks in other listener methods, I felt it doesn't hurt to add it here as well.

Fixes the following issue(s)

#6233

APK testing

On the website the APK can be found by going to the "Checks" tab below the title and then on "artifacts" on the right.

Due diligence

@TobiGr TobiGr added bug Issue is related to a bug player Issues related to any player (main, popup and background) labels Jun 25, 2021
@Redirion Redirion requested a review from triallax June 30, 2021 16:21
Copy link
Contributor

@triallax triallax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't seem to reproduce the NPE with this. Code also LGTM.

@TobiGr TobiGr merged commit 83b198f into TeamNewPipe:dev Jul 3, 2021
@opusforlife2 opusforlife2 changed the title Fix NPE when connecting via BT Fix crash when connecting to a Bluetooth device Jul 3, 2021
@Redirion Redirion deleted the fixnpe branch July 3, 2021 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is related to a bug player Issues related to any player (main, popup and background)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants