1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-02-22 05:50:07 +00:00

Fix crash when closing video detail fragment

This bug started appearing because the way to close the player is now unified in PlayerHolder.stopService(), which causes the player to reach back to the video detail fragment with a notification of the shutdown (i.e. onServiceStopped() is called). This is fixed by adding a nullability check on the binding.
This commit is contained in:
Stypox 2025-02-18 18:03:10 +01:00
parent 6558794d26
commit 126f4b0e30
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23

View File

@ -1848,13 +1848,16 @@ public final class VideoDetailFragment
@Override
public void onServiceStopped() {
setOverlayPlayPauseImage(false);
if (currentInfo != null) {
updateOverlayData(currentInfo.getName(),
currentInfo.getUploaderName(),
currentInfo.getThumbnails());
// the binding could be null at this point, if the app is finishing
if (binding != null) {
setOverlayPlayPauseImage(false);
if (currentInfo != null) {
updateOverlayData(currentInfo.getName(),
currentInfo.getUploaderName(),
currentInfo.getThumbnails());
}
updateOverlayPlayQueueButtonVisibility();
}
updateOverlayPlayQueueButtonVisibility();
}
@Override