Skip to content
This repository was archived by the owner on Dec 4, 2025. It is now read-only.

Commit 6815ea1

Browse files
committed
fix(enum): Fix the index out-of-bounds exception when the enumeration value is empty.
1 parent bdd248b commit 6815ea1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/com/ly/doc/utils/JavaClassUtil.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1693,7 +1693,9 @@ private static EnumInfoAndValues generateEnumInfoAndValues(EnumInfo enumInfo, Ja
16931693

16941694
if (enumValue == null) {
16951695
enumValues = items.stream().map(Item::getName).collect(Collectors.toList());
1696-
enumValue = enumValues.get(0);
1696+
if (CollectionUtil.isNotEmpty(enumValues)) {
1697+
enumValue = enumValues.get(0);
1698+
}
16971699
type = ParamTypeConstants.PARAM_TYPE_ENUM;
16981700
}
16991701

0 commit comments

Comments
 (0)