Commit d29ef7e2 authored by Guus der Kinderen's avatar Guus der Kinderen

Fix NPE when no packets were queued before start or fail of new session.

parent a0ce00e5
......@@ -131,7 +131,7 @@ public class LocalOutgoingServerProxy implements RoutableChannelHandler {
log.debug("Spun up new session to {}", domain.toString());
int sent = 0;
this.session = session;
while (!this.packets.isEmpty()) {
while (this.packets != null && !this.packets.isEmpty()) {
Packet packet = this.packets.remove();
this.session.process(packet);
sent = sent + 1;
......@@ -143,7 +143,7 @@ public class LocalOutgoingServerProxy implements RoutableChannelHandler {
protected synchronized void sessionFailed() {
isTrying = false;
log.debug("Failed to spin up new session to {}", domain.toString());
while (!this.packets.isEmpty()) {
while (this.packets != null && !this.packets.isEmpty()) {
Packet packet = this.packets.remove();
LocalSession.returnErrorToSender(packet);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment