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

Commit ea00f2b2 authored by Kevin Chyn's avatar Kevin Chyn
Browse files

Check for NPE when sending enroll result

It's possible for the client to crash and have the service continue to
receive results for a short amount of time.

Bug: 126212114

Test: system server doesn't die anymore
Change-Id: I574b605eba50169a611cae8e95c46aa61defcb9c
parent 17c63bab
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -76,7 +76,10 @@ public abstract class EnrollClient extends ClientMonitor {
        }
        mMetricsLogger.action(mMetrics.actionBiometricEnroll());
        try {
            getListener().onEnrollResult(identifier, remaining);
            final BiometricServiceBase.ServiceListener listener = getListener();
            if (listener != null) {
                listener.onEnrollResult(identifier, remaining);
            }
            return remaining == 0;
        } catch (RemoteException e) {
            Slog.w(getLogTag(), "Failed to notify EnrollResult:", e);