mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Merge "Throw exception when the header cannot be read."
This commit is contained in:
commit
03105290d8
@ -173,6 +173,9 @@ public class Ver2DictDecoder extends AbstractDictDecoder {
|
|||||||
@Override
|
@Override
|
||||||
public DictionaryHeader readHeader() throws IOException, UnsupportedFormatException {
|
public DictionaryHeader readHeader() throws IOException, UnsupportedFormatException {
|
||||||
final DictionaryHeader header = mBinaryDictionary.getHeader();
|
final DictionaryHeader header = mBinaryDictionary.getHeader();
|
||||||
|
if (header == null) {
|
||||||
|
throw new IOException("Cannot read the dictionary header.");
|
||||||
|
}
|
||||||
if (header.mFormatOptions.mVersion != FormatSpec.VERSION2) {
|
if (header.mFormatOptions.mVersion != FormatSpec.VERSION2) {
|
||||||
throw new UnsupportedFormatException("File header has a wrong version : "
|
throw new UnsupportedFormatException("File header has a wrong version : "
|
||||||
+ header.mFormatOptions.mVersion);
|
+ header.mFormatOptions.mVersion);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user