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

Commit 1e27ae70 authored by Kevin Chyn's avatar Kevin Chyn
Browse files

Add null check before using mCallback

There's some strange cases where onErrorInternal is being invoked
but mCallback is null. However, currently we only have a stack trace.
If this really is a problem, a bugreport will be needed. We can only
fix the NPE for now.

Fixes: 166187582
Test: Builds
Change-Id: I8ea932aadb15757383f273b0f6232b379c6b9ae1
parent 34639f47
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -98,9 +98,13 @@ public abstract class AcquisitionClient<T> extends ClientMonitor<T> implements I
        }
        }


        if (finish) {
        if (finish) {
            if (mCallback == null) {
                Slog.e(TAG, "Callback is null, perhaps the client hasn't been started yet?");
            } else {
                mCallback.onClientFinished(this, false /* success */);
                mCallback.onClientFinished(this, false /* success */);
            }
            }
        }
        }
    }


    @Override
    @Override
    public void cancel() {
    public void cancel() {