Null-check mEvaluator onDestroy()

Fixes: 34742420
Change-Id: Ia1e99a121855b43fbaec648a0be25e6b40d9b255
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 @@
             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) {