Fix NPE in a unit test.

Change-Id: I0dfc23232ed77e1ff1aedecfa6ac022020cb1c19
diff --git a/tests/src/com/android/inputmethod/latin/BinaryDictionaryTests.java b/tests/src/com/android/inputmethod/latin/BinaryDictionaryTests.java
index a26c258..65c70a6 100644
--- a/tests/src/com/android/inputmethod/latin/BinaryDictionaryTests.java
+++ b/tests/src/com/android/inputmethod/latin/BinaryDictionaryTests.java
@@ -993,6 +993,10 @@
         for (final String word : words) {
             final UnigramProperty unigramProperty = binaryDictionary.getUnigramProperty(word);
             assertEquals((int)unigramProbabilities.get(word), unigramProperty.mProbability);
+            if (!shortcutTargets.containsKey(word)) {
+                // The word does not have shortcut targets.
+                continue;
+            }
             assertEquals(shortcutTargets.get(word).size(), unigramProperty.mShortcutTargets.size());
             for (final WeightedString shortcutTarget : unigramProperty.mShortcutTargets) {
                 final String targetCodePonts = shortcutTarget.mWord;