Used requireArguments instead of getArguments

(cherry picked from commit a3673f8c3b3152c5fdef7313693ef16654ea3931)
This commit is contained in:
Siddhesh Dhainje 2026-01-04 21:40:40 +05:30 committed by Tobi
parent d5d92e8340
commit 381b383a43

View File

@ -18,7 +18,7 @@ import org.schabi.newpipe.R;
public class ImportConfirmationDialog extends DialogFragment {
@State
protected Intent resultServiceIntent;
static final String EXTRA_RESULT_SERVICE_INTENT = "extra_result_service_intent";
private static final String EXTRA_RESULT_SERVICE_INTENT = "extra_result_service_intent";
public static void show(@NonNull final Fragment fragment,
@NonNull final Intent resultServiceIntent) {
@ -49,13 +49,7 @@ public class ImportConfirmationDialog extends DialogFragment {
public void onCreate(@Nullable final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
resultServiceIntent = getArguments().getParcelable(EXTRA_RESULT_SERVICE_INTENT);
}
if (resultServiceIntent == null) {
throw new IllegalStateException("Result intent is null");
}
resultServiceIntent = requireArguments().getParcelable(EXTRA_RESULT_SERVICE_INTENT);
Bridge.restoreInstanceState(this, savedInstanceState);
}