From f6ae8dcb8b2eed6e90a1f98a312e080d7f819d7b Mon Sep 17 00:00:00 2001 From: Ahab Date: Tue, 10 Apr 2018 12:13:44 +0200 Subject: [PATCH] Patch null messages It doesn't send null or emptty messages anymore --- src/com/em/miguelbridge/Launcher.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/em/miguelbridge/Launcher.java b/src/com/em/miguelbridge/Launcher.java index 74ec5a7..9550eb6 100644 --- a/src/com/em/miguelbridge/Launcher.java +++ b/src/com/em/miguelbridge/Launcher.java @@ -73,7 +73,9 @@ public class Launcher { lastMessageId = getLastMessageId(matrixRoomId); newMessaggio = (String[]) matrixBot.getLastMessage(matrixRoomId); - if (!newMessaggio[0].equals(matrixBot.readBotUserName()) && !newMessaggio[2].equals(lastMessageId)) { + if (!newMessaggio[0].equals(matrixBot.readBotUserName()) && + !newMessaggio[2].equals(lastMessageId) && + !newMessaggio[1].equals("") && newMessaggio[1] != null) { String tgroomid = (String) room.get("tgid"); tgBot.cEcho(tgroomid, newMessaggio[0] + ":\n" + newMessaggio[1]); }