diff --git a/sentinel-transport/sentinel-transport-simple-http/src/main/java/com/alibaba/csp/sentinel/transport/heartbeat/client/SimpleHttpClient.java b/sentinel-transport/sentinel-transport-simple-http/src/main/java/com/alibaba/csp/sentinel/transport/heartbeat/client/SimpleHttpClient.java index 6befd46f38..5ec54e9fc1 100755 --- a/sentinel-transport/sentinel-transport-simple-http/src/main/java/com/alibaba/csp/sentinel/transport/heartbeat/client/SimpleHttpClient.java +++ b/sentinel-transport/sentinel-transport-simple-http/src/main/java/com/alibaba/csp/sentinel/transport/heartbeat/client/SimpleHttpClient.java @@ -156,6 +156,9 @@ private String getStatusLine(RequestMethod type, String requestPath) { * @return encoded request parameters, or empty string ("") if no parameters are provided */ private String encodeRequestParams(Map paramsMap, Charset charset) { + if (charset == null) { + throw new IllegalArgumentException("charset is not allowed to be null"); + } if (paramsMap == null || paramsMap.isEmpty()) { return ""; }