diff --git a/kernel-d-scanner/scanner-api/src/main/java/cn/stylefeng/roses/kernel/scanner/api/util/ClassReflectUtil.java b/kernel-d-scanner/scanner-api/src/main/java/cn/stylefeng/roses/kernel/scanner/api/util/ClassReflectUtil.java index 15bf9d26d..4069bd3fa 100644 --- a/kernel-d-scanner/scanner-api/src/main/java/cn/stylefeng/roses/kernel/scanner/api/util/ClassReflectUtil.java +++ b/kernel-d-scanner/scanner-api/src/main/java/cn/stylefeng/roses/kernel/scanner/api/util/ClassReflectUtil.java @@ -303,9 +303,11 @@ public class ClassReflectUtil { FieldMetadata fieldMetadata = genericFieldAndNameMap.get(fieldActualTypeArgument.getTypeName()); if (ObjectUtil.isNotEmpty(fieldMetadata)) { FieldMetadata metadata = fieldAndNameMap.get(field.getName()); - Set metadataSet = new LinkedHashSet<>(); - metadataSet.add(fieldMetadata); - metadata.setGenericFieldMetadata(metadataSet); + if (ObjectUtil.isNotEmpty(metadata)) { + Set metadataSet = new LinkedHashSet<>(); + metadataSet.add(fieldMetadata); + metadata.setGenericFieldMetadata(metadataSet); + } } } }