Skip to content

Commit

Permalink
Check if receiver was created before trying to close it when destroyi…
Browse files Browse the repository at this point in the history
…ng the context. (#55)

Motivation:

We need to check for null before trying to close the reciver as we might not have created it yet.

Modifications:

Add null check

Result:

No more NPE possible
  • Loading branch information
normanmaurer authored Mar 26, 2024
1 parent cfdf09c commit 85eb83a
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,11 @@ boolean sendLastHttpContent() {

@Override
void destroyCrypto() {
receiver.close();
// check for null as the receiver might not have been created yet if we destroy
// before decoding the prefix.
if (receiver != null) {
receiver.close();
}
}
}
}

0 comments on commit 85eb83a

Please sign in to comment.