diff options
author | 2014-02-19 04:59:47 +0000 | |
---|---|---|
committer | 2014-02-19 04:59:47 +0000 | |
commit | 03105290d840c86b6fe9376bade466e606391141 (patch) | |
tree | 4d784994e27fa74cbee6059e0f5cac1ff137cb6b /java/src | |
parent | 776bba098b8777763128e78bc3f110a7250e27ae (diff) | |
parent | 97a40d030f92458976356058cc9746f881902221 (diff) | |
download | latinime-03105290d840c86b6fe9376bade466e606391141.tar.gz latinime-03105290d840c86b6fe9376bade466e606391141.tar.xz latinime-03105290d840c86b6fe9376bade466e606391141.zip |
Merge "Throw exception when the header cannot be read."
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/makedict/Ver2DictDecoder.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/makedict/Ver2DictDecoder.java b/java/src/com/android/inputmethod/latin/makedict/Ver2DictDecoder.java index 315bd8e58..71e120c5f 100644 --- a/java/src/com/android/inputmethod/latin/makedict/Ver2DictDecoder.java +++ b/java/src/com/android/inputmethod/latin/makedict/Ver2DictDecoder.java @@ -173,6 +173,9 @@ public class Ver2DictDecoder extends AbstractDictDecoder { @Override public DictionaryHeader readHeader() throws IOException, UnsupportedFormatException { final DictionaryHeader header = mBinaryDictionary.getHeader(); + if (header == null) { + throw new IOException("Cannot read the dictionary header."); + } if (header.mFormatOptions.mVersion != FormatSpec.VERSION2) { throw new UnsupportedFormatException("File header has a wrong version : " + header.mFormatOptions.mVersion); |