[modules/vpn] Fix tests

Add a guard in case nmcli is not installed or does not return anything.
This commit is contained in:
Tobias Witek 2019-06-14 20:09:03 +02:00
parent bf57496093
commit 71d80ded40

View file

@ -35,8 +35,11 @@ class Module(bumblebee.engine.Module):
self._vpn_profiles = [] self._vpn_profiles = []
for line in lines: for line in lines:
info = line.split(':') info = line.split(':')
if info[1] == "vpn": try:
self._vpn_profiles.append(info[0]) if info[1] == "vpn":
self._vpn_profiles.append(info[0])
except:
pass
engine.input.register_callback(self, button=bumblebee.input.LEFT_MOUSE, engine.input.register_callback(self, button=bumblebee.input.LEFT_MOUSE,
cmd=self.popup) cmd=self.popup)