Skip to content

Commit

Permalink
ARTEMIS-5166 Improving ReconnectTest (avoiding NPEs)
Browse files Browse the repository at this point in the history
  • Loading branch information
clebertsuconic committed Nov 21, 2024
1 parent 7965877 commit e985ec5
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,12 @@ public void testClosingConsumerTimeout() throws Exception {
}

boolean matchConsumers(ActiveMQServer server, ClientSessionInternal session, ClientConsumer clientConsumer) {
Set<ServerConsumer> serverConsumers = server.getSessionByID(session.getName()).getServerConsumers();
if (serverConsumers.size() != 1) {
ServerSession serverSession = server.getSessionByID(session.getName());
if (serverSession == null) {
return false;
}
Set<ServerConsumer> serverConsumers = serverSession.getServerConsumers();
if (serverConsumers == null || serverConsumers.size() != 1) {
return false;
}
ServerConsumer serverConsumer = serverConsumers.iterator().next();
Expand Down

0 comments on commit e985ec5

Please sign in to comment.