Skip to content

Commit

Permalink
fix: SpotBugs: NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE Spotbug
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Marchenko authored and mymarche committed Dec 5, 2024
1 parent 68362fe commit 99b6f84
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,11 @@ private static ResultContainer<String> 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)

Check warning on line 149 in src/main/java/io/jenkins/plugins/restlistparam/logic/RestValueService.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 149 is only partially covered, one branch is missing
value = body.string();
container.setValue(value);
}
else if (statusCode < 500) {
log.warning(Messages.RLP_RestValueService_warn_ReqClientErr(statusCode));
Expand Down

0 comments on commit 99b6f84

Please sign in to comment.