chiark / gitweb /
sd-bus: it's not a user error to query the error contained in a bus message
authorLennart Poettering <lennart@poettering.net>
Thu, 27 Aug 2015 10:54:35 +0000 (12:54 +0200)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 09:19:06 +0000 (10:19 +0100)
It's an OK way to check whether a message contains an erro, let's not
consider this a loggable assertion event.

src/libelogind/sd-bus/bus-message.c

index dad6db8..378d1af 100644 (file)
@@ -1030,7 +1030,9 @@ _public_ const char *sd_bus_message_get_sender(sd_bus_message *m) {
 
 _public_ const sd_bus_error *sd_bus_message_get_error(sd_bus_message *m) {
         assert_return(m, NULL);
-        assert_return(sd_bus_error_is_set(&m->error), NULL);
+
+        if (!sd_bus_error_is_set(&m->error))
+                return NULL;
 
         return &m->error;
 }