Skip to content
Snippets Groups Projects
Commit 97a40d03 authored by Keisuke Kuroyanagi's avatar Keisuke Kuroyanagi
Browse files

Throw exception when the header cannot be read.

Bug: 13066902
Change-Id: I8fd0f361a4ca55aaab8a2bd2e11f48f92b87fc93
parent e49e007b
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment