mirror of
				https://github.com/TeamNewPipe/NewPipe
				synced 2025-10-31 07:13:00 +00:00 
			
		
		
		
	Merge pull request #8661 from Stypox/player-refactor-npe
Fix random NullPointerException when adding video player view
This commit is contained in:
		| @@ -1312,9 +1312,11 @@ public final class VideoDetailFragment | |||||||
|         // Prevent from re-adding a view multiple times |         // Prevent from re-adding a view multiple times | ||||||
|         new Handler(Looper.getMainLooper()).post(() -> |         new Handler(Looper.getMainLooper()).post(() -> | ||||||
|                 player.UIs().get(MainPlayerUi.class).ifPresent(playerUi -> { |                 player.UIs().get(MainPlayerUi.class).ifPresent(playerUi -> { | ||||||
|                     playerUi.removeViewFromParent(); |                     if (binding != null) { | ||||||
|                     binding.playerPlaceholder.addView(playerUi.getBinding().getRoot()); |                         playerUi.removeViewFromParent(); | ||||||
|                     playerUi.setupVideoSurfaceIfNeeded(); |                         binding.playerPlaceholder.addView(playerUi.getBinding().getRoot()); | ||||||
|  |                         playerUi.setupVideoSurfaceIfNeeded(); | ||||||
|  |                     } | ||||||
|                 })); |                 })); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Stypox
					Stypox