From 2fe35d578d3d1b155b3feb4b06546230ff282df2 Mon Sep 17 00:00:00 2001 From: YumeMichi Date: Fri, 12 Jan 2018 11:23:47 +0800 Subject: [PATCH] Check fm before using it * Prevent NPE on devices without fingerprint. --- src/main/java/com/topjohnwu/magisk/utils/FingerprintHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/topjohnwu/magisk/utils/FingerprintHelper.java b/src/main/java/com/topjohnwu/magisk/utils/FingerprintHelper.java index e556489af..f9a961f7e 100644 --- a/src/main/java/com/topjohnwu/magisk/utils/FingerprintHelper.java +++ b/src/main/java/com/topjohnwu/magisk/utils/FingerprintHelper.java @@ -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 {