Fixed potential error if user tries to send endsession to a group

This commit is contained in:
Herohtar 2018-12-14 09:14:05 -06:00
parent 25a137987b
commit 47b3c86f0e
No known key found for this signature in database
GPG key ID: 5C362C8125768A2B

View file

@ -46,13 +46,7 @@ public class SendCommand implements DbusCommand {
return 1;
}
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;
}
if (ns.getBoolean("endsession")) {
if (ns.getBoolean("endsession") && ns.getList("recipient") != null && ns.getList("recipient").size() > 0) {
try {
signal.sendEndSessionMessage(ns.<String>getList("recipient"));
return 0;
@ -71,6 +65,12 @@ 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 {