diff --git a/src/main/java/io/jenkins/plugins/restlistparam/logic/RestValueService.java b/src/main/java/io/jenkins/plugins/restlistparam/logic/RestValueService.java index c1dcdad..5d5a5fc 100644 --- a/src/main/java/io/jenkins/plugins/restlistparam/logic/RestValueService.java +++ b/src/main/java/io/jenkins/plugins/restlistparam/logic/RestValueService.java @@ -144,7 +144,11 @@ private static ResultContainer getValueStringFromRestEndpoint(final Stri try (Response response = client.newCall(request).execute()) { int statusCode = response.code(); if (statusCode < 400) { - container.setValue(response.body() != null ? response.body().string() : ""); + String value = ""; + okhttp3.ResponseBody body = response.body(); + if (body != null) + value = body.string(); + container.setValue(value); } else if (statusCode < 500) { log.warning(Messages.RLP_RestValueService_warn_ReqClientErr(statusCode));