aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java
diff options
context:
space:
mode:
authorKeisuke Kuroyanagi <ksk@google.com>2014-01-06 09:53:15 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-01-06 09:53:15 +0000
commit6d5f9fd3d1ee903f9355905326cd75e7ee603d4e (patch)
tree3552103a95246e2f62f5c239b93ea20b2fafb3dd /java/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java
parent74b5291b84cdafad90ef1d30ecf8a6c43040a6a1 (diff)
parent8214a8c2cf29ef28ccf515b9df1390299fd4cbdd (diff)
downloadlatinime-6d5f9fd3d1ee903f9355905326cd75e7ee603d4e.tar.gz
latinime-6d5f9fd3d1ee903f9355905326cd75e7ee603d4e.tar.xz
latinime-6d5f9fd3d1ee903f9355905326cd75e7ee603d4e.zip
Merge "Fix possible NPE."
Diffstat (limited to 'java/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java')
-rw-r--r--java/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java b/java/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java
index 2dbb5eb93..9a24c47af 100644
--- a/java/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java
+++ b/java/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java
@@ -643,6 +643,10 @@ public final class BinaryDictDecoderUtils {
* @return true if it's a binary dictionary, false otherwise
*/
public static boolean isBinaryDictionary(final File file) {
- return FormatSpec.getDictDecoder(file).hasValidRawBinaryDictionary();
+ final DictDecoder dictDecoder = FormatSpec.getDictDecoder(file);
+ if (dictDecoder == null) {
+ return false;
+ }
+ return dictDecoder.hasValidRawBinaryDictionary();
}
}