OSDN Git Service

Settings is crashed high probability when doing follow steps
authoredgar.huang <edgar.huang@spreadtrum.com>
Thu, 31 Aug 2017 03:22:25 +0000 (11:22 +0800)
committeredgar huang <edgar.huang@spreadtrum.com>
Tue, 5 Sep 2017 06:35:27 +0000 (06:35 +0000)
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.

src/com/android/settings/fingerprint/FingerprintSettings.java

index 64ce901..607d28c 100644 (file)
@@ -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;