From a54654ba700b1fc6f5cc92e88e2c5544fd7ad2fd Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Mon, 23 Dec 2019 16:35:15 +0100
Subject: [PATCH] core: don't check potentially NULL error, it's not gonna work
 anyway

---
 src/core/unit.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/core/unit.c b/src/core/unit.c
index c54abe9..7ea0e8a 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -3219,11 +3219,10 @@ static int get_name_owner_handler(sd_bus_message *message, void *userdata, sd_bu
         u->get_name_owner_slot = sd_bus_slot_unref(u->get_name_owner_slot);
 
         e = sd_bus_message_get_error(message);
-        if (sd_bus_error_has_name(e, "org.freedesktop.DBus.Error.NameHasNoOwner"))
-                return 0;
-
         if (e) {
-                log_error("Unexpected error response from GetNameOwner: %s", e->message);
+                if (!sd_bus_error_has_name(e, "org.freedesktop.DBus.Error.NameHasNoOwner"))
+                        log_unit_error(u, "Unexpected error response from GetNameOwner(): %s", e->message);
+
                 return 0;
         }
 
-- 
1.8.3.1

