dryang / rpms / systemd

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