Fix a NPE when highlighting fingerprint row.

If fingerprint pref is not bound to UI yet, then its view is null so we
can't do any ripple animation on it.

Change-Id: I0ccca2dfdb471ab520677c6cd206205230959b27
Fixes: 80147956
Test: manual
This commit is contained in:
Fan Zhang
2018-05-23 13:21:31 -07:00
parent 1cedea2383
commit 13c7e68646

View File

@@ -605,6 +605,10 @@ public class FingerprintSettings extends SubSettings {
final Drawable highlight = getHighlightDrawable();
if (highlight != null && fpref != null) {
final View view = fpref.getView();
if (view == null) {
// FingerprintPreference is not bound to UI yet, so view is null.
return;
}
final int centerX = view.getWidth() / 2;
final int centerY = view.getHeight() / 2;
highlight.setHotspot(centerX, centerY);