From: edgar.huang Date: Thu, 31 Aug 2017 03:22:25 +0000 (+0800) Subject: Settings is crashed high probability when doing follow steps X-Git-Tag: android-x86-9.0-r1~89^2^2~3^2~27^2~40^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=ab6f11f47f8842c8c0baccf9a171ffee5a09e490;p=android-x86%2Fpackages-apps-Settings.git Settings is crashed high probability when doing follow steps Enter into the fingerprint list screen and delete and identification of operation at the same time, when the item of the fingerprint verification was deleted, highlighting the item to be deleted, just so NullPointerException occurred. Test: manual - enrolling a fingerprint and do above steps. --- diff --git a/src/com/android/settings/fingerprint/FingerprintSettings.java b/src/com/android/settings/fingerprint/FingerprintSettings.java index 64ce901926..607d28cdd7 100644 --- a/src/com/android/settings/fingerprint/FingerprintSettings.java +++ b/src/com/android/settings/fingerprint/FingerprintSettings.java @@ -558,7 +558,7 @@ public class FingerprintSettings extends SubSettings { String prefName = genKey(fpId); FingerprintPreference fpref = (FingerprintPreference) findPreference(prefName); final Drawable highlight = getHighlightDrawable(); - if (highlight != null) { + if (highlight != null && fpref != null) { final View view = fpref.getView(); final int centerX = view.getWidth() / 2; final int centerY = view.getHeight() / 2;