mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-06 17:18:02 +02:00
iwd: add some missing error handling
g_dbus_object_manager_get_interface() can happily return NULL and we
need to check for that.
(cherry picked from commit 59923ad85d)
This commit is contained in:
parent
4c11364201
commit
8a668d0983
1 changed files with 10 additions and 0 deletions
|
|
@ -150,6 +150,11 @@ agent_dbus_method_cb (GDBusConnection *connection,
|
||||||
network = g_dbus_object_manager_get_interface (priv->object_manager,
|
network = g_dbus_object_manager_get_interface (priv->object_manager,
|
||||||
network_path,
|
network_path,
|
||||||
NM_IWD_NETWORK_INTERFACE);
|
NM_IWD_NETWORK_INTERFACE);
|
||||||
|
if (!network) {
|
||||||
|
_LOGE ("unable to find the network object");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
device_path = get_property_string_or_null (G_DBUS_PROXY (network), "Device");
|
device_path = get_property_string_or_null (G_DBUS_PROXY (network), "Device");
|
||||||
if (!device_path) {
|
if (!device_path) {
|
||||||
|
|
@ -274,6 +279,11 @@ register_agent (NMIwdManager *self)
|
||||||
"/",
|
"/",
|
||||||
NM_IWD_AGENT_MANAGER_INTERFACE);
|
NM_IWD_AGENT_MANAGER_INTERFACE);
|
||||||
|
|
||||||
|
if (!agent_manager) {
|
||||||
|
_LOGE ("unable to register the IWD Agent: PSK/8021x Wi-Fi networks may not work");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Register our agent */
|
/* Register our agent */
|
||||||
g_dbus_proxy_call (G_DBUS_PROXY (agent_manager),
|
g_dbus_proxy_call (G_DBUS_PROXY (agent_manager),
|
||||||
"RegisterAgent",
|
"RegisterAgent",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue