diff options
| author | 2023-03-10 10:19:57 +0000 | |
|---|---|---|
| committer | 2023-03-10 10:20:06 +0000 | |
| commit | 8cdc827f82dd6e37f5f07649638e77d73480ec07 (patch) | |
| tree | 0a751c762fdde116dcea1dbe4a8796748177334d | |
| parent | b2c6c792b02937cc02111b6a2d62c482796f56d0 (diff) | |
InputMethodManagerServiceTestBase: make robust against setup failure
Fixes an issue where if setup fails, teardown will throw an NPE and
hide the real issue.
Bug: 272633154
Change-Id: I16f5c6d90720f3845a7da5229de3537c9a9dc668
Test: n/a
| -rw-r--r-- | services/tests/InputMethodSystemServerTests/src/com/android/server/inputmethod/InputMethodManagerServiceTestBase.java | 4 |
1 files changed, 3 insertions, 1 deletions
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 7cd55f326366..9829e57c6ef8 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(); |