summaryrefslogtreecommitdiff
path: root/src/device.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/device.c')
-rw-r--r--src/device.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/device.c b/src/device.c
index 2a8e7dab..75561c9f 100644
--- a/src/device.c
+++ b/src/device.c
@@ -656,8 +656,6 @@ static void unregister_network(gpointer data)
connman_element_unregister((struct connman_element *) network);
connman_network_unref(network);
-
- __connman_network_set_device(network, NULL);
}
static void device_destruct(struct connman_element *element)
@@ -1468,6 +1466,9 @@ void __connman_device_set_network(struct connman_device *device,
{
const char *name;
+ if (device == NULL)
+ return;
+
if (device->network == network)
return;