Merge "Fix TextServicesManagerService NPE in UserDictionaryProvider" into main am: a7143d8010 am: e9b16d8e71

Original change: https://android-review.googlesource.com/c/platform/packages/providers/UserDictionaryProvider/+/3222116

Change-Id: Ie1c0590e5618e6ca88e21240672c6c7546a43cda
Signed-off-by: Automerger Merge Worker <[email protected]>
diff --git a/src/com/android/providers/userdictionary/UserDictionaryProvider.java b/src/com/android/providers/userdictionary/UserDictionaryProvider.java
index 5abeefa..8b6728c 100644
--- a/src/com/android/providers/userdictionary/UserDictionaryProvider.java
+++ b/src/com/android/providers/userdictionary/UserDictionaryProvider.java
@@ -336,7 +336,8 @@
             }
         }
 
-        SpellCheckerInfo[] scInfos = mTextServiceManager.getEnabledSpellCheckers();
+        SpellCheckerInfo[] scInfos =
+                mTextServiceManager == null ? null : mTextServiceManager.getEnabledSpellCheckers();
         if (scInfos != null) {
             for (SpellCheckerInfo scInfo : scInfos) {
                 if (scInfo.getServiceInfo().applicationInfo.uid == callingUid