[Minor] don't try to retry null message

This commit is contained in:
Robert von Burg 2022-05-05 15:20:00 +02:00
parent d8e51c67ec
commit e1ce116460
Signed by: eitch
GPG Key ID: 75DB9C85C74331F7
1 changed files with 6 additions and 3 deletions

View File

@ -546,9 +546,12 @@ public class PlcGwClientHandler extends StrolchComponent implements GlobalPlcLis
} catch (Exception e) {
closeBrokenGwSessionUpdateState("Failed to send message",
"Failed to send message, reconnecting in " + RETRY_DELAY + "s.");
this.messageQueue.addFirst(callable);
logger.error("Failed to send message, reconnecting in " + RETRY_DELAY + "s. And then retrying message.",
e);
if (callable != null) {
this.messageQueue.addFirst(callable);
logger.error(
"Failed to send message, reconnecting in " + RETRY_DELAY + "s. And then retrying message.",
e);
}
delayConnect(RETRY_DELAY, TimeUnit.SECONDS);
}