cid#1326440 Dereference null return value

...replacing implicit NullPointerException with explicit RuntimeException

Change-Id: I14dfe81a6a05d33cb311a6274c085ea0dcf95692
This commit is contained in:
Stephan Bergmann 2016-02-23 17:28:43 +01:00
parent 670c2b3ca9
commit 74a18f64ee

View File

@ -112,6 +112,10 @@ final class Unmarshal {
public TypeDescription readType() {
int b = read8Bit();
TypeClass typeClass = TypeClass.fromInt(b & 0x7F);
if (typeClass == null) {
throw new RuntimeException(
"Reading TYPE with bad type class " + (b & 0x7F));
}
if (TypeDescription.isTypeClassSimple(typeClass)) {
return TypeDescription.getTypeDescription(typeClass);
} else {