diff --git a/toolkit-common/src/main/java/iot/technology/client/toolkit/common/http/HttpRequestExecutor.java b/toolkit-common/src/main/java/iot/technology/client/toolkit/common/http/HttpRequestExecutor.java index b1f654a5..ee172c8f 100644 --- a/toolkit-common/src/main/java/iot/technology/client/toolkit/common/http/HttpRequestExecutor.java +++ b/toolkit-common/src/main/java/iot/technology/client/toolkit/common/http/HttpRequestExecutor.java @@ -48,7 +48,7 @@ public static HttpResponseEntity executePost(HttpRequestEntity request) { Request.Builder builder = new Request.Builder(); builder.url(httpBuilder.build()).post(body); - if (!request.getHeaders().isEmpty()) { + if (request.getHeaders() != null && !request.getHeaders().isEmpty()) { builder.headers(Headers.of(request.getHeaders())); } Call call = client.newCall(builder.build());