From 8b1a9c920fa201882fa28b26f26362eca7dc3b15 Mon Sep 17 00:00:00 2001 From: wenc000 <450292408@qq.com> Date: Mon, 11 May 2020 17:24:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86string=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/cm/common/utils/annotation/AnnotationUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud-common/src/main/java/com/cm/common/utils/annotation/AnnotationUtil.java b/cloud-common/src/main/java/com/cm/common/utils/annotation/AnnotationUtil.java index 6710fc5..fdc668e 100644 --- a/cloud-common/src/main/java/com/cm/common/utils/annotation/AnnotationUtil.java +++ b/cloud-common/src/main/java/com/cm/common/utils/annotation/AnnotationUtil.java @@ -52,7 +52,7 @@ public class AnnotationUtil { checkTypes(checkNullAnnotation.name(), fieldValue.toString(), checkNullAnnotation.types()); } else if (field.isAnnotationPresent(CheckEmptyAnnotation.class)) { CheckEmptyAnnotation checkEmptyAnnotation = field.getAnnotation(CheckEmptyAnnotation.class); - if (StringUtils.isBlank(fieldValue.toString())) { + if (fieldValue == null || StringUtils.isBlank(fieldValue.toString())) { throw new ParamsException(String.format("%s不能为空或空串", checkEmptyAnnotation.name())); } checkRegular(checkEmptyAnnotation.name(), fieldValue.toString(), checkEmptyAnnotation.verifyType(), checkEmptyAnnotation.regex());