Skip to content

Commit

Permalink
handle npe
Browse files Browse the repository at this point in the history
  • Loading branch information
supertick committed May 20, 2024
1 parent 00507de commit 4b5ccef
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/java/org/myrobotlab/service/HttpClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,11 @@ public String postForm(String url, Map<String, String> fields) throws ClientProt
}

public byte[] postBytes(String url, Map<String, String> headers, byte[] data) throws ClientProtocolException, IOException {

HttpRequestData rd = new HttpRequestData("POST", url, new String(data));
String strData = null;
if (data != null) {
strData = new String(data);
}
HttpRequestData rd = new HttpRequestData("POST", url, strData);
invoke("publishHttpRequestData", rd);

HttpPost request = new HttpPost(url);
Expand Down

0 comments on commit 4b5ccef

Please sign in to comment.