naccyde / rpms / systemd

Forked from rpms/systemd a year ago
Clone
c2dfb7
From e607286e070675498fcd5a7ab73bc3da533f9eea Mon Sep 17 00:00:00 2001
c2dfb7
From: Balint Reczey <balint.reczey@canonical.com>
c2dfb7
Date: Wed, 22 Apr 2020 09:51:53 +0200
c2dfb7
Subject: [PATCH] shared: Don't try calling NULL callback in
c2dfb7
 bus_wait_for_units_clear
c2dfb7
c2dfb7
BugLink: https://bugs.launchpad.net/bugs/1870930
c2dfb7
(cherry picked from commit 9f656373082cb13542b877b4f5cb917ef5ff329c)
c2dfb7
c2dfb7
Related: #1830861
c2dfb7
---
c2dfb7
 src/shared/bus-wait-for-units.c | 3 ++-
c2dfb7
 1 file changed, 2 insertions(+), 1 deletion(-)
c2dfb7
c2dfb7
diff --git a/src/shared/bus-wait-for-units.c b/src/shared/bus-wait-for-units.c
c2dfb7
index de15da1620..63ba3fd422 100644
c2dfb7
--- a/src/shared/bus-wait-for-units.c
c2dfb7
+++ b/src/shared/bus-wait-for-units.c
c2dfb7
@@ -91,7 +91,8 @@ static void bus_wait_for_units_clear(BusWaitForUnits *d) {
c2dfb7
         while ((item = hashmap_first(d->items))) {
c2dfb7
                 d->current = item;
c2dfb7
 
c2dfb7
-                item->unit_callback(d, item->bus_path, false, item->userdata);
c2dfb7
+                if (item->unit_callback)
c2dfb7
+                        item->unit_callback(d, item->bus_path, false, item->userdata);
c2dfb7
                 wait_for_item_free(item);
c2dfb7
         }
c2dfb7