summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dbus-job.c7
-rw-r--r--src/dbus-unit.c7
2 files changed, 8 insertions, 6 deletions
diff --git a/src/dbus-job.c b/src/dbus-job.c
index 653e11d18c..4572589cd3 100644
--- a/src/dbus-job.c
+++ b/src/dbus-job.c
@@ -172,10 +172,11 @@ void bus_job_send_change_signal(Job *j) {
DBusMessage *m = NULL;
assert(j);
- assert(j->in_dbus_queue);
- LIST_REMOVE(Job, dbus_queue, j->manager->dbus_job_queue, j);
- j->in_dbus_queue = false;
+ if (j->in_dbus_queue) {
+ LIST_REMOVE(Job, dbus_queue, j->manager->dbus_job_queue, j);
+ j->in_dbus_queue = false;
+ }
if (!bus_has_subscriber(j->manager) && !j->bus_client) {
j->sent_dbus_new_signal = true;
diff --git a/src/dbus-unit.c b/src/dbus-unit.c
index ad0c193eae..735e5a53f2 100644
--- a/src/dbus-unit.c
+++ b/src/dbus-unit.c
@@ -371,10 +371,11 @@ void bus_unit_send_change_signal(Unit *u) {
DBusMessage *m = NULL;
assert(u);
- assert(u->meta.in_dbus_queue);
- LIST_REMOVE(Meta, dbus_queue, u->meta.manager->dbus_unit_queue, &u->meta);
- u->meta.in_dbus_queue = false;
+ if (u->meta.in_dbus_queue) {
+ LIST_REMOVE(Meta, dbus_queue, u->meta.manager->dbus_unit_queue, &u->meta);
+ u->meta.in_dbus_queue = false;
+ }
if (!bus_has_subscriber(u->meta.manager)) {
u->meta.sent_dbus_new_signal = true;