Merge "Fix NPE in *GenerateChallengeClient" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
4eaca4eb94
@@ -52,7 +52,13 @@ public class FaceGenerateChallengeClient extends GenerateChallengeClient<ISessio
|
|||||||
|
|
||||||
void onChallengeGenerated(int sensorId, int userId, long challenge) {
|
void onChallengeGenerated(int sensorId, int userId, long challenge) {
|
||||||
try {
|
try {
|
||||||
getListener().onChallengeGenerated(sensorId, userId, challenge);
|
final ClientMonitorCallbackConverter listener = getListener();
|
||||||
|
if (listener == null) {
|
||||||
|
Slog.e(TAG, "Listener is null in onChallengeGenerated");
|
||||||
|
mCallback.onClientFinished(this, false /* success */);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
listener.onChallengeGenerated(sensorId, userId, challenge);
|
||||||
mCallback.onClientFinished(this, true /* success */);
|
mCallback.onClientFinished(this, true /* success */);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Slog.e(TAG, "Unable to send challenge", e);
|
Slog.e(TAG, "Unable to send challenge", e);
|
||||||
|
|||||||
@@ -53,7 +53,13 @@ class FingerprintGenerateChallengeClient extends GenerateChallengeClient<ISessio
|
|||||||
|
|
||||||
void onChallengeGenerated(int sensorId, int userId, long challenge) {
|
void onChallengeGenerated(int sensorId, int userId, long challenge) {
|
||||||
try {
|
try {
|
||||||
getListener().onChallengeGenerated(sensorId, userId, challenge);
|
final ClientMonitorCallbackConverter listener = getListener();
|
||||||
|
if (listener == null) {
|
||||||
|
Slog.e(TAG, "Listener is null in onChallengeGenerated");
|
||||||
|
mCallback.onClientFinished(this, false /* success */);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
listener.onChallengeGenerated(sensorId, userId, challenge);
|
||||||
mCallback.onClientFinished(this, true /* success */);
|
mCallback.onClientFinished(this, true /* success */);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Slog.e(TAG, "Unable to send challenge", e);
|
Slog.e(TAG, "Unable to send challenge", e);
|
||||||
|
|||||||
Reference in New Issue
Block a user