Fix possible NPE in SubtypeSwitcher

Bug: 18299267
Change-Id: I0403fe8537f7a10f4af121d1e88ed029e69aa494
diff --git a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java
index 6fc5495..6fb0e4a 100644
--- a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java
+++ b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java
@@ -122,7 +122,10 @@
     }
 
     public void refreshSubtypeInfo() {
-        onSubtypeChanged(mRichImm.getCurrentRawSubtype());
+        final InputMethodSubtype subtype = mRichImm.getCurrentRawSubtype();
+        if (subtype != null) {
+            onSubtypeChanged(subtype);
+        }
     }
 
     /**