!1 修复可能的空指针异常

Merge pull request !1 from 刘越锋/detached
pull/62/head
刘越锋 7 months ago committed by Gitee
commit ea0fad7266
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

@ -5,6 +5,7 @@ import org.springframework.util.PropertyPlaceholderHelper;
import java.text.MessageFormat;
import java.util.Map;
import java.util.Objects;
/**
* @author 3y
@ -43,6 +44,10 @@ public class ContentHolderUtil {
@Override
public String resolvePlaceholder(String placeholderName) {
if (Objects.isNull(paramMap)) {
String errorStr = MessageFormat.format("template:{0} require param:{1},but not exist! paramMap:{2}", template, placeholderName, paramMap);
throw new IllegalArgumentException(errorStr);
}
String value = paramMap.get(placeholderName);
if (StringUtils.isEmpty(value)) {
String errorStr = MessageFormat.format("template:{0} require param:{1},but not exist! paramMap:{2}", template, placeholderName, paramMap);

Loading…
Cancel
Save