diff --git a/services/tests/InputMethodSystemServerTests/src/com/android/server/inputmethod/InputMethodManagerServiceTestBase.java b/services/tests/InputMethodSystemServerTests/src/com/android/server/inputmethod/InputMethodManagerServiceTestBase.java index 7cd55f326366c..9829e57c6ef85 100644 --- a/services/tests/InputMethodSystemServerTests/src/com/android/server/inputmethod/InputMethodManagerServiceTestBase.java +++ b/services/tests/InputMethodSystemServerTests/src/com/android/server/inputmethod/InputMethodManagerServiceTestBase.java @@ -240,7 +240,9 @@ public class InputMethodManagerServiceTestBase { @After public void tearDown() { - mInputMethodManagerService.mInputMethodDeviceConfigs.destroy(); + if (mInputMethodManagerService != null) { + mInputMethodManagerService.mInputMethodDeviceConfigs.destroy(); + } if (mServiceThread != null) { mServiceThread.quitSafely();