From 51c130b40651b1d01caee7175235f2632f5aa73e Mon Sep 17 00:00:00 2001 From: Herohtar Date: Fri, 14 Dec 2018 11:15:12 -0600 Subject: [PATCH] Don't abort on empty recipient unless there was also no group specified. (#176) * Don't abort on empty recipient unless there was also no group specified. * Fixed potential error if user tries to send `endsession` to a group * Display error if trying to send `endsession` to a group * No need for this check since we're handling that condition above --- src/main/java/org/asamk/signal/commands/SendCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/asamk/signal/commands/SendCommand.java b/src/main/java/org/asamk/signal/commands/SendCommand.java index 308e564c..176c2d92 100644 --- a/src/main/java/org/asamk/signal/commands/SendCommand.java +++ b/src/main/java/org/asamk/signal/commands/SendCommand.java @@ -46,7 +46,7 @@ public class SendCommand implements DbusCommand { return 1; } - if (ns.getList("recipient") == null || ns.getList("recipient").size() == 0) { + if ((ns.getList("recipient") == null || ns.getList("recipient").size() == 0) && (ns.getBoolean("endsession") || ns.getString("group") == null)) { System.err.println("No recipients given"); System.err.println("Aborting sending."); return 1;