Display error if trying to send endsession to a group

This commit is contained in:
Herohtar 2018-12-14 10:22:36 -06:00
parent 47b3c86f0e
commit 57c35cb8cc
No known key found for this signature in database
GPG key ID: 5C362C8125768A2B

View file

@ -46,6 +46,12 @@ public class SendCommand implements DbusCommand {
return 1;
}
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;
}
if (ns.getBoolean("endsession") && ns.getList("recipient") != null && ns.getList("recipient").size() > 0) {
try {
signal.sendEndSessionMessage(ns.<String>getList("recipient"));
@ -65,12 +71,6 @@ public class SendCommand implements DbusCommand {
}
}
if ((ns.getList("recipient") == null || ns.getList("recipient").size() == 0) && ns.getString("group") == null) {
System.err.println("No recipients given");
System.err.println("Aborting sending.");
return 1;
}
String messageText = ns.getString("message");
if (messageText == null) {
try {