Merge "Fix crash when changing navigation modes" into qt-dev
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/RotationContextButton.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/RotationContextButton.java
index f1460a6..b117dec 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/RotationContextButton.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/RotationContextButton.java
@@ -66,7 +66,9 @@
 
     @Override
     public void onDestroy() {
-        mRotationButtonController.cleanUp();
+        if (mRotationButtonController != null) {
+            mRotationButtonController.cleanUp();
+        }
     }
 
     @Override