#include "bus-internal.h"
#include "bus-message.h"
#include "bus-match.h"
+#include "bus-error.h"
+#include "bus-util.h"
/* Example:
*
* should contain all well-known names of the sender,
* hence we can fix things there correctly. */
- if (node->value.str[0] != ':' && value_str[0] == ':')
+ if (node->value.str[0] != ':' && value_str && value_str[0] == ':')
return true;
return false;
/* Run the callback. And then invoke siblings. */
if (node->leaf.callback) {
- r = node->leaf.callback(bus, m, node->leaf.userdata);
+ _cleanup_bus_error_free_ sd_bus_error error_buffer = SD_BUS_ERROR_NULL;
+
+ r = node->leaf.callback(bus, m, node->leaf.userdata, &error_buffer);
+ r = bus_maybe_reply_error(m, r, &error_buffer);
if (r != 0)
return r;
}
escaped = false;
}
+ if (!value) {
+ value = strdup("");
+ if (!value) {
+ r = -ENOMEM;
+ goto fail;
+ }
+ }
+
if (t == BUS_MATCH_MESSAGE_TYPE) {
r = bus_message_type_from_string(value, &u);
if (r < 0)