From d47d2e4ff6972e262139f368a108ce8ac0b6577d Mon Sep 17 00:00:00 2001 From: Luis Vidal Date: Fri, 5 Aug 2016 12:54:12 -0700 Subject: Settings: Animate pin/pattern fragment only if available To prevent NPE, check if the PIN/Pattern/Password confirmation fragment is available before performing animation Change-Id: I4ae78569f953daa6696e96c8318a0c059aaf3502 TICKET: HAM-1397 --- .../android/settings/ConfirmDeviceCredentialBaseActivity.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/com/android/settings/ConfirmDeviceCredentialBaseActivity.java b/src/com/android/settings/ConfirmDeviceCredentialBaseActivity.java index d9af800..2d78de2 100644 --- a/src/com/android/settings/ConfirmDeviceCredentialBaseActivity.java +++ b/src/com/android/settings/ConfirmDeviceCredentialBaseActivity.java @@ -92,11 +92,17 @@ public abstract class ConfirmDeviceCredentialBaseActivity extends SettingsActivi } public void prepareEnterAnimation() { - getFragment().prepareEnterAnimation(); + final ConfirmDeviceCredentialBaseFragment f = getFragment(); + if (f != null) { + f.prepareEnterAnimation(); + } } public void startEnterAnimation() { - getFragment().startEnterAnimation(); + final ConfirmDeviceCredentialBaseFragment f = getFragment(); + if (f != null) { + f.startEnterAnimation(); + } } /** -- cgit v1.1