mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-28 04:25:27 +00:00
Check fm before using it
* Prevent NPE on devices without fingerprint.
This commit is contained in:
parent
8d139e156e
commit
2fe35d578d
@ -30,7 +30,7 @@ public abstract class FingerprintHelper extends FingerprintManager.Authenticatio
|
|||||||
MagiskManager mm = MagiskManager.get();
|
MagiskManager mm = MagiskManager.get();
|
||||||
KeyguardManager km = mm.getSystemService(KeyguardManager.class);
|
KeyguardManager km = mm.getSystemService(KeyguardManager.class);
|
||||||
FingerprintManager fm = mm.getSystemService(FingerprintManager.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 {
|
protected FingerprintHelper() throws Exception {
|
||||||
|
Loading…
Reference in New Issue
Block a user