Skip to content

Commit a3673f8

Browse files
committed
Used requireArguments instead of getArguments
1 parent 23b7f21 commit a3673f8

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

app/src/main/java/org/schabi/newpipe/local/subscription/ImportConfirmationDialog.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
public class ImportConfirmationDialog extends DialogFragment {
1919
@State
2020
protected Intent resultServiceIntent;
21-
static final String EXTRA_RESULT_SERVICE_INTENT = "extra_result_service_intent";
21+
private static final String EXTRA_RESULT_SERVICE_INTENT = "extra_result_service_intent";
2222

2323
public static void show(@NonNull final Fragment fragment,
2424
@NonNull final Intent resultServiceIntent) {
@@ -49,13 +49,7 @@ public Dialog onCreateDialog(@Nullable final Bundle savedInstanceState) {
4949
public void onCreate(@Nullable final Bundle savedInstanceState) {
5050
super.onCreate(savedInstanceState);
5151

52-
if (getArguments() != null) {
53-
resultServiceIntent = getArguments().getParcelable(EXTRA_RESULT_SERVICE_INTENT);
54-
}
55-
56-
if (resultServiceIntent == null) {
57-
throw new IllegalStateException("Result intent is null");
58-
}
52+
resultServiceIntent = requireArguments().getParcelable(EXTRA_RESULT_SERVICE_INTENT);
5953

6054
Bridge.restoreInstanceState(this, savedInstanceState);
6155
}

0 commit comments

Comments
 (0)