diff options
author | 2014-02-18 21:01:16 -0800 | |
---|---|---|
committer | 2014-02-18 21:01:16 -0800 | |
commit | 20dee7106ef9d766777f39854c99bf977fc73f33 (patch) | |
tree | 0f34e26b81748327f6f675e05572a518952215a6 | |
parent | b68eff5f7db19c61d8bb35adc7edcb79f529e0ff (diff) | |
parent | 03105290d840c86b6fe9376bade466e606391141 (diff) | |
download | latinime-20dee7106ef9d766777f39854c99bf977fc73f33.tar.gz latinime-20dee7106ef9d766777f39854c99bf977fc73f33.tar.xz latinime-20dee7106ef9d766777f39854c99bf977fc73f33.zip |
am 03105290: Merge "Throw exception when the header cannot be read."
* commit '03105290d840c86b6fe9376bade466e606391141':
Throw exception when the header cannot be read.
-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); |