]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared: Don't try calling NULL callback in bus_wait_for_units_clear
authorBalint Reczey <balint.reczey@canonical.com>
Wed, 22 Apr 2020 07:51:53 +0000 (09:51 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 23 Apr 2020 10:25:20 +0000 (12:25 +0200)
BugLink: https://bugs.launchpad.net/bugs/1870930
src/shared/bus-wait-for-units.c

index 78b2a604038c6bd94e77473d022c92f5c9758af4..ed0442f2c6d63f6d20e5f4017c5ff9d2dca7bd3f 100644 (file)
@@ -91,7 +91,8 @@ static void bus_wait_for_units_clear(BusWaitForUnits *d) {
         while ((item = hashmap_first(d->items))) {
                 d->current = item;
 
-                item->unit_callback(d, item->bus_path, false, item->userdata);
+                if (item->unit_callback)
+                        item->unit_callback(d, item->bus_path, false, item->userdata);
                 wait_for_item_free(item);
         }