File tree Expand file tree Collapse file tree
app/src/main/java/org/schabi/newpipe/fragments/detail Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -657,7 +657,10 @@ protected void initListeners() {
657657 binding .detailControlsPlayWithKodi .setOnClickListener (this );
658658 if (DEBUG ) {
659659 binding .detailControlsCrashThePlayer .setOnClickListener (
660- v -> VideoDetailPlayerCrasher .onCrashThePlayer (this .player , getLayoutInflater ())
660+ v -> VideoDetailPlayerCrasher .onCrashThePlayer (
661+ this .getContext (),
662+ this .player ,
663+ getLayoutInflater ())
661664 );
662665 }
663666
Original file line number Diff line number Diff line change 1010import android .widget .Toast ;
1111
1212import androidx .annotation .NonNull ;
13+ import androidx .annotation .Nullable ;
1314import androidx .appcompat .app .AlertDialog ;
1415
1516import com .google .android .exoplayer2 .C ;
@@ -85,9 +86,12 @@ private static Context getThemeWrapperContext(final Context context) {
8586 : R .style .DarkTheme );
8687 }
8788
88- public static void onCrashThePlayer (final Player player , final LayoutInflater layoutInflater ) {
89- final Context context = player .getContext ();
90- if (!isPlayerAvailable (player )) {
89+ public static void onCrashThePlayer (
90+ @ NonNull final Context context ,
91+ @ Nullable final Player player ,
92+ @ NonNull final LayoutInflater layoutInflater
93+ ) {
94+ if (player == null ) {
9195 Log .d (TAG , "Player is not available" );
9296 Toast .makeText (context , "Player is not available" , Toast .LENGTH_SHORT )
9397 .show ();
@@ -152,8 +156,4 @@ private static void tryCrashPlayerWith(
152156 exPlayer );
153157 }
154158 }
155-
156- private static boolean isPlayerAvailable (final Player player ) {
157- return player != null ;
158- }
159159}
You can’t perform that action at this time.
0 commit comments