Ignore Wifis with missing network name on macOS. Fixes #429 (#440)

* Ignore Wifis with missing network name on macOS. Fixes #429
* Fix additional exception when Wifi list cant be parsed as reported by @kdambekalns.
This commit is contained in:
Manu 2020-05-22 16:09:39 +08:00 committed by GitHub
parent 08598cb45e
commit 426b849938
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -136,7 +136,7 @@ def get_sorted_wifis(profile):
wifis = plistlib.load(plist_file).get('KnownNetworks')
except xml.parsers.expat.ExpatError:
logger.error('Unable to parse list of Wifi networks.')
return
return []
if wifis is not None:
for wifi in wifis.values():