Check fm before using it

* Prevent NPE on devices without fingerprint.
This commit is contained in:
YumeMichi 2018-01-12 11:23:47 +08:00 committed by John Wu
parent 8d139e156e
commit 2fe35d578d

View File

@ -30,7 +30,7 @@ public abstract class FingerprintHelper extends FingerprintManager.Authenticatio
MagiskManager mm = MagiskManager.get();
KeyguardManager km = mm.getSystemService(KeyguardManager.class);
FingerprintManager fm = mm.getSystemService(FingerprintManager.class);
return km.isKeyguardSecure() && fm.isHardwareDetected() && fm.hasEnrolledFingerprints();
return km.isKeyguardSecure() && fm != null && fm.isHardwareDetected() && fm.hasEnrolledFingerprints();
}
protected FingerprintHelper() throws Exception {