summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnnie Chin <afchin@google.com>2017-01-30 08:46:47 -0800
committerAnnie Chin <afchin@google.com>2017-01-30 08:48:07 -0800
commit1838cf7da0b9ca5f245f7747fc4253d06ca79852 (patch)
treeab660f2f1d02c4dde4137cc7b48474fef052798c
parent33aab39308cdf0e33b9630b607610c3b713289dc (diff)
downloadandroid_packages_apps_ExactCalculator-1838cf7da0b9ca5f245f7747fc4253d06ca79852.tar.gz
android_packages_apps_ExactCalculator-1838cf7da0b9ca5f245f7747fc4253d06ca79852.tar.bz2
android_packages_apps_ExactCalculator-1838cf7da0b9ca5f245f7747fc4253d06ca79852.zip
Null-check mEvaluator onDestroy()
Fixes: 34742420 Change-Id: Ia1e99a121855b43fbaec648a0be25e6b40d9b255
-rw-r--r--src/com/android/calculator2/HistoryFragment.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/com/android/calculator2/HistoryFragment.java b/src/com/android/calculator2/HistoryFragment.java
index 64a94f9..e2c0974 100644
--- a/src/com/android/calculator2/HistoryFragment.java
+++ b/src/com/android/calculator2/HistoryFragment.java
@@ -176,9 +176,11 @@ public class HistoryFragment extends Fragment implements DragLayout.DragCallback
mDragLayout.removeDragCallback(this);
}
- // Note that the view is destroyed when the fragment backstack is popped, so
- // these are essentially called when the DragLayout is closed.
- mEvaluator.cancelNonMain();
+ if (mEvaluator != null) {
+ // Note that the view is destroyed when the fragment backstack is popped, so
+ // these are essentially called when the DragLayout is closed.
+ mEvaluator.cancelNonMain();
+ }
}
private void initializeController(boolean isResult, boolean isOneLine) {