diff --git a/src/android/Fingerprint.java b/src/android/Fingerprint.java index f36c57fb..8319ab39 100644 --- a/src/android/Fingerprint.java +++ b/src/android/Fingerprint.java @@ -252,7 +252,7 @@ public void run() { mCallbackContext.sendPluginResult(mPluginResult); } return true; - } else if (action.equals("isAvailable")) { + } else if (action.equals("isAvailable") && null != mFingerPrintManager) { if(mFingerPrintManager.isHardwareDetected() && mFingerPrintManager.hasEnrolledFingerprints()){ mPluginResult = new PluginResult(PluginResult.Status.OK, "finger"); mCallbackContext.success("finger"); @@ -272,7 +272,8 @@ public void run() { } private boolean isFingerprintAuthAvailable() { - return mFingerPrintManager.isHardwareDetected() + return null != mFingerPrintManager + && mFingerPrintManager.isHardwareDetected() && mFingerPrintManager.hasEnrolledFingerprints(); }