diff options
author | 2014-02-19 12:35:58 +0900 | |
---|---|---|
committer | 2014-02-19 12:35:58 +0900 | |
commit | 97a40d030f92458976356058cc9746f881902221 (patch) | |
tree | 503af4cff92bbeede3f7e4c86f8cb4c26d47f386 /java/src | |
parent | e49e007bb233ab9ac0bfa8a36fcb4a67e41496c8 (diff) | |
download | latinime-97a40d030f92458976356058cc9746f881902221.tar.gz latinime-97a40d030f92458976356058cc9746f881902221.tar.xz latinime-97a40d030f92458976356058cc9746f881902221.zip |
Throw exception when the header cannot be read.
Bug: 13066902
Change-Id: I8fd0f361a4ca55aaab8a2bd2e11f48f92b87fc93
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); |