Skip to content

Commit

Permalink
HttpLogSender fix: Checking if connrection.getErrorStream() returns n…
Browse files Browse the repository at this point in the history
…ull.
  • Loading branch information
mj committed Jun 4, 2022
1 parent a9a91c2 commit 58876ec
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/java/pl/mjaron/tinyloki/HttpLogSender.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@ public void send(final byte[] message) {
} catch (final IOException e) {
if (connection != null) {
try (final InputStream errorStream = connection.getErrorStream()) {
while (true) {
if (errorStream.read() == -1) {
break;
if (errorStream != null) {
while (true) {
if (errorStream.read() == -1) {
break;
}
}
}
} catch (final IOException e2) {
Expand Down

0 comments on commit 58876ec

Please sign in to comment.