Skip to content

Commit f9f3683

Browse files
committed
Fix the issue of a null enumeration field causing a null pointer exception.
1 parent 723ce5a commit f9f3683

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaClass.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,7 @@
1919
* under the License.
2020
*/
2121

22-
import java.util.Collection;
23-
import java.util.LinkedHashMap;
24-
import java.util.LinkedHashSet;
25-
import java.util.LinkedList;
26-
import java.util.List;
27-
import java.util.Map;
28-
import java.util.Set;
22+
import java.util.*;
2923

3024
import com.thoughtworks.qdox.library.ClassLibrary;
3125
import com.thoughtworks.qdox.model.BeanProperty;
@@ -589,7 +583,7 @@ public List<JavaField> getEnumConstants()
589583
{
590584
for ( JavaField field : getFields() )
591585
{
592-
if ( field.isEnumConstant() )
586+
if ( Objects.nonNull(field) && field.isEnumConstant() )
593587
{
594588
result.add( field );
595589
}

0 commit comments

Comments
 (0)