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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user