From 3b7b7881b1f25620d264572048c64a49f169f8d6 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 1 Mar 2016 21:54:25 +0530 Subject: [PATCH] networks: Fix issue when looking up AP details As reported by Jan Costermans, it is possible that for an access point scanned by a Wi-Fi device, get_ssid() returns None. The reported as follows: if access_point.get_ssid().get_data() == ssid: AttributeError: 'NoneType' object has no attribute 'get_data' --- plinth/network.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plinth/network.py b/plinth/network.py index 6350ceb51..13d96d839 100644 --- a/plinth/network.py +++ b/plinth/network.py @@ -172,7 +172,8 @@ def get_status_from_wifi_access_point(device, ssid): return status for access_point in device.get_access_points(): - if access_point.get_ssid().get_data() == ssid: + if access_point and access_point.get_ssid() and \ + access_point.get_ssid().get_data() == ssid: status['strength'] = access_point.get_strength() frequency = access_point.get_frequency() status['channel'] = _get_wifi_channel_from_frequency(frequency)