Skip to content

Commit 99b6f84

Browse files
Mikhail Marchenkomymarche
authored andcommitted
fix: SpotBugs: NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE Spotbug
1 parent 68362fe commit 99b6f84

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/io/jenkins/plugins/restlistparam/logic/RestValueService.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,11 @@ private static ResultContainer<String> getValueStringFromRestEndpoint(final Stri
144144
try (Response response = client.newCall(request).execute()) {
145145
int statusCode = response.code();
146146
if (statusCode < 400) {
147-
container.setValue(response.body() != null ? response.body().string() : "");
147+
String value = "";
148+
okhttp3.ResponseBody body = response.body();
149+
if (body != null)
150+
value = body.string();
151+
container.setValue(value);
148152
}
149153
else if (statusCode < 500) {
150154
log.warning(Messages.RLP_RestValueService_warn_ReqClientErr(statusCode));

0 commit comments

Comments
 (0)