summaryrefslogtreecommitdiff
path: root/src/systemctl/systemctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/systemctl/systemctl.c')
-rw-r--r--src/systemctl/systemctl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 0def1a2f55..bfa4d45fc2 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -1738,6 +1738,9 @@ static int reboot_with_logind(DBusConnection *bus, enum action a) {
const char *method;
dbus_bool_t interactive = true;
+ if (!bus)
+ return -EIO;
+
polkit_agent_open_if_enabled();
switch (a) {