From: Herohtar Date: Fri, 14 Dec 2018 17:15:12 +0000 (-0600) Subject: Don't abort on empty recipient unless there was also no group specified. (#176) X-Git-Tag: v0.6.2~2 X-Git-Url: https://git.nmode.ca/signal-cli/commitdiff_plain/51c130b40651b1d01caee7175235f2632f5aa73e?ds=inline 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 --- 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;