aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.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/BinaryDictIOUtils.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/BinaryDictIOUtils.java')
-rw-r--r--java/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java b/java/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java
index 07ba777c7..0dc50d14e 100644
--- a/java/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java
+++ b/java/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java
@@ -309,6 +309,7 @@ public final class BinaryDictIOUtils {
* @param file The file to read.
* @param offset The offset in the file where to start reading the data.
* @param length The length of the data file.
+ * @return the header of the specified dictionary file.
*/
private static FileHeader getDictionaryFileHeader(
final File file, final long offset, final long length)
@@ -330,6 +331,9 @@ public final class BinaryDictIOUtils {
}
}
);
+ if (dictDecoder == null) {
+ return null;
+ }
return dictDecoder.readHeader();
}