Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e4b08837 authored by SongFerngWang's avatar SongFerngWang Committed by SongFerng Wang
Browse files

Fix IllegalArgumentException

Add the try-catch to avoid crash.

Fix: 301362148
Test: build pass
Change-Id: Ia1f5a4299d5f0eeffc7b25b0f3b89d56f1647062
parent cb624a31
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -176,7 +176,13 @@ public class ConfirmDialogFragment extends BaseDialogFragment
    }

    private void informCaller(boolean confirmed, int itemPosition) {
        OnConfirmListener listener = getListener(OnConfirmListener.class);
        OnConfirmListener listener;
        try {
            listener = getListener(OnConfirmListener.class);
        } catch (IllegalArgumentException e) {
            Log.e(TAG, "Do nothing and return.", e);
            return;
        }
        if (listener == null) {
            return;
        }