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 random NullPointerException when adding video player view #8661

Merged
merged 1 commit into from
Aug 2, 2022

Conversation

Stypox
Copy link
Member

@Stypox Stypox commented Jul 19, 2022

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

Followup to #8170, bug reported by @opusforlife2. I don't know why the binding could be null when getView() returns a non-null value, unless the view is destroyed exactly in between new Handler().post() being called and the passed function being actually called, but anyway...

Fixes the following comments

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR.

Due diligence

@sonarcloud
Copy link

sonarcloud bot commented Jul 19, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@AudricV AudricV added bug Issue is related to a bug player Issues related to any player (main, popup and background) labels Jul 19, 2022
@opusforlife2
Copy link
Collaborator

I discovered something stupid :D

I tried the player-refactor APK again just to compare it with this PR. The bug didn't occur!

And then some testing led me to realise that the crash occurs only when the full screen button is tapped while the device is moving! So if the device stays still on a surface or you keep your hand still while holding it, the full screen button works properly. But if the accelerometer registers movement, there is a crash.

This bug is so strange that I think it must be CalyxOS-specific.

Anyway, this PR fixes this weird bug.

@Stypox
Copy link
Member Author

Stypox commented Aug 2, 2022

Merging as it is such a simple change and opus said it is now fixed for him.

only when the full screen button is tapped while the device is moving

It kinda makes sense, since the fixed code has to do with adding the video player view (also) after layout changes, but strange nonetheless ;-)

@Stypox Stypox merged commit 3420faa into TeamNewPipe:dev Aug 2, 2022
@Stypox Stypox deleted the player-refactor-npe branch August 4, 2022 09:51
@Stypox Stypox mentioned this pull request Aug 27, 2022
9 tasks
ShareASmile added a commit to ShareASmile/NewPipe-Legacy-Revo that referenced this pull request Jun 22, 2024
add TeamNewPipe/NewPipe#8661 to legacy flora

Co-Authored-By: Stypox <stypox@pm.me>
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