kavinaidoo / pmap

PMAP is a battery-powered portable audio player built around the "pHAT" form factor.
3 stars 2 forks source link

Error in wifi_network_info() causing crash #27

Closed kavinaidoo closed 11 months ago

kavinaidoo commented 11 months ago

It appears that this code, present in pmap_network.py:

ip_and_name = [[nmcli.connection.show(x)['IP4.ADDRESS[1]'],x] for x in wifi_conns if 'IP4.ADDRESS[1]' in nmcli.connection.show(x)]

can cause a crash due to the "if" portion returning true but then having nmcli.connection.show(x)['IP4.ADDRESS[1]'],x] throw KeyError: 'IP4.ADDRESS[1]'

Occurred when network state was changing from hotspot to client WiFi mode.