Skip to content

Commit

Permalink
Fix potential NPE in InstrumentedResourceMethodApplicationListener (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
joschi committed Feb 15, 2023
1 parent b3bc3bf commit 72a9ed8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ public void onEvent(RequestEvent event) {
ContainerResponse containerResponse = event.getContainerResponse();
if (containerResponse == null && event.getException() != null) {
metric.mark(500);
} else {
} else if (containerResponse != null) {
metric.mark(containerResponse.getStatus());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ public void onEvent(RequestEvent event) {
ContainerResponse containerResponse = event.getContainerResponse();
if (containerResponse == null && event.getException() != null) {
metric.mark(500);
} else {
} else if (containerResponse != null) {
metric.mark(containerResponse.getStatus());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ public void onEvent(RequestEvent event) {
ContainerResponse containerResponse = event.getContainerResponse();
if (containerResponse == null && event.getException() != null) {
metric.mark(500);
} else {
} else if (containerResponse != null) {
metric.mark(containerResponse.getStatus());
}
}
Expand Down

0 comments on commit 72a9ed8

Please sign in to comment.