Fix crash when changing navigation modes

- The controller is only set on the active button, and when we tear
  down the nav bar, we try to update the controller from the other
  button

Bug: 132201048
Test: Switch navigation mode, ensure no crash
Change-Id: Id324c67946769193a4decab1a3d5e9d3967fc6fb
This commit is contained in:
Winson Chung
2019-05-28 17:21:26 -07:00
parent dd91e676b0
commit 559f5557fa

View File

@@ -66,7 +66,9 @@ public class RotationContextButton extends ContextualButton implements
@Override
public void onDestroy() {
mRotationButtonController.cleanUp();
if (mRotationButtonController != null) {
mRotationButtonController.cleanUp();
}
}
@Override