Fix logic error / possible NPE in AuthenticationSidecar

Fixes: 67329646

Test: manual
Change-Id: Ifec339dbc9112c0a1e1ad6595deaab4ec328d365
This commit is contained in:
Kevin Chyn
2017-10-02 19:02:32 -07:00
parent 301cfcda4c
commit 9c8739c8e1

View File

@@ -117,12 +117,12 @@ public class FingerprintAuthenticateSidecar extends InstrumentedPreferenceFragme
public void setListener(Listener listener) { public void setListener(Listener listener) {
if (mListener == null && listener != null) { if (mListener == null && listener != null) {
if (mAuthenticationResult != null) { if (mAuthenticationResult != null) {
mListener.onAuthenticationSucceeded(mAuthenticationResult); listener.onAuthenticationSucceeded(mAuthenticationResult);
mAuthenticationResult = null; mAuthenticationResult = null;
} }
if (mAuthenticationError != null && if (mAuthenticationError != null &&
mAuthenticationError.error != FingerprintManager.FINGERPRINT_ERROR_CANCELED) { mAuthenticationError.error != FingerprintManager.FINGERPRINT_ERROR_CANCELED) {
mListener.onAuthenticationError(mAuthenticationError.error, listener.onAuthenticationError(mAuthenticationError.error,
mAuthenticationError.errorString); mAuthenticationError.errorString);
mAuthenticationError = null; mAuthenticationError = null;
} }