From 8e4abf282f5cd3d25c82a8fac72893ac9ca75270 Mon Sep 17 00:00:00 2001 From: Daniel Steglich Date: Fri, 1 Jan 2016 22:48:11 +0000 Subject: [PATCH] networks: fix for primary connection Closes: #334 Check if there is any primary connection available before accessing this connections parameter. Otherwise Plinth will raise an exception because of non existing object. --- plinth/network.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plinth/network.py b/plinth/network.py index 286ac579e..7075c21b9 100644 --- a/plinth/network.py +++ b/plinth/network.py @@ -102,7 +102,9 @@ def get_status_from_connection(connection): status['wireless']['ssid'] = setting_wireless.get_ssid().get_data() primary_connection = nm.Client.new(None).get_primary_connection() - status['primary'] = (primary_connection.get_uuid() == connection.get_uuid()) + if primary_connection: + status['primary'] = (primary_connection.get_uuid() == + connection.get_uuid()) return status