Skip to content

Commit

Permalink
Fix random NullPointerException when adding video player view
Browse files Browse the repository at this point in the history
add TeamNewPipe/NewPipe#8661 to legacy flora

Co-Authored-By: Stypox <stypox@pm.me>
  • Loading branch information
ShareASmile and Stypox committed Jun 22, 2024
1 parent b776584 commit 049b468
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1323,9 +1323,11 @@ private void addVideoPlayerView() {
// Prevent from re-adding a view multiple times
new Handler(Looper.getMainLooper()).post(() ->
player.UIs().get(MainPlayerUi.class).ifPresent(playerUi -> {
playerUi.removeViewFromParent();
binding.playerPlaceholder.addView(playerUi.getBinding().getRoot());
playerUi.setupVideoSurfaceIfNeeded();
if (binding != null) {
playerUi.removeViewFromParent();
binding.playerPlaceholder.addView(playerUi.getBinding().getRoot());
playerUi.setupVideoSurfaceIfNeeded();
}
}));
}

Expand Down

0 comments on commit 049b468

Please sign in to comment.