diff --git a/tests/src/com/android/inputmethod/latin/BinaryDictionaryTests.java b/tests/src/com/android/inputmethod/latin/BinaryDictionaryTests.java
index 9c7792c..b15987f 100644
--- a/tests/src/com/android/inputmethod/latin/BinaryDictionaryTests.java
+++ b/tests/src/com/android/inputmethod/latin/BinaryDictionaryTests.java
@@ -1237,15 +1237,17 @@
             wordSet.remove(word0);
             final HashSet<String> bigramWord1s = bigrams.get(word0);
             // TODO: Support ngram.
-            for (final WeightedString bigramTarget : wordProperty.getBigrams()) {
-                final String word1 = bigramTarget.mWord;
-                assertTrue(bigramWord1s.contains(word1));
-                final Pair<String, String> bigram = new Pair<>(word0, word1);
-                if (canCheckBigramProbability(formatVersion)) {
-                    final int bigramProbability = bigramProbabilitiesToCheckLater.get(bigram);
-                    assertEquals(bigramProbability, bigramTarget.getProbability());
+            if (wordProperty.mHasNgrams) {
+                for (final WeightedString bigramTarget : wordProperty.getBigrams()) {
+                    final String word1 = bigramTarget.mWord;
+                    assertTrue(bigramWord1s.contains(word1));
+                    final Pair<String, String> bigram = new Pair<>(word0, word1);
+                    if (canCheckBigramProbability(formatVersion)) {
+                        final int bigramProbability = bigramProbabilitiesToCheckLater.get(bigram);
+                        assertEquals(bigramProbability, bigramTarget.getProbability());
+                    }
+                    bigramSet.remove(bigram);
                 }
-                bigramSet.remove(bigram);
             }
             token = result.mNextToken;
         } while (token != 0);
