This avoids an invalid D-Bus call during interface initialization.
The wpa_state change can happen before the D-Bus interface is set up,
so we must be preparted to handle this early event signal. In theory,
it should be possible to reorder initialization code to make sure
D-Bus signals are ready, but that would likely require quite a bit of
code restructuring, so it looks like a safer option for now is to just
skip the early event.
WPADBusPropertyAccessor getter;
char *prop;
+ if (wpa_s->dbus_new_path == NULL)
+ return; /* Skip signal since D-Bus setup is not yet ready */
+
switch (property) {
case WPAS_DBUS_PROP_AP_SCAN:
getter = (WPADBusPropertyAccessor) wpas_dbus_getter_ap_scan;
DBusMessage *_signal = NULL;
const char *new_state_str, *old_state_str;
+ if (wpa_s->dbus_path == NULL)
+ return; /* Skip signal since D-Bus setup is not yet ready */
+
/* Do nothing if the control interface is not turned on */
if (wpa_s->global == NULL)
return;