From 735aadbab4660e9edcdd460573acb59cce81cb7e Mon Sep 17 00:00:00 2001 From: Volker Berlin Date: Sun, 12 Jan 2020 16:59:02 +0100 Subject: [PATCH] fix NPE --- src/de/inetsoftware/classparser/ClassFile.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/de/inetsoftware/classparser/ClassFile.java b/src/de/inetsoftware/classparser/ClassFile.java index 2944d04..a4ced98 100644 --- a/src/de/inetsoftware/classparser/ClassFile.java +++ b/src/de/inetsoftware/classparser/ClassFile.java @@ -285,12 +285,14 @@ public class ClassFile { /** * Get the type of class. + * + * @return the type of the class */ public Type getType() { if( (accessFlags & 0x0200) > 0 ) { return Type.Interface; } - if( superClass.getName().equals( "java/lang/Enum" ) ) { + if( superClass != null && superClass.getName().equals( "java/lang/Enum" ) ) { return Type.Enum; } return Type.Class;