diff options
author | Kali Kaneko <kali@leap.se> | 2017-08-14 20:43:56 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2017-08-15 16:51:47 -0400 |
commit | 8ebd7753c8e91bd1db032220fd0c5295947d64f0 (patch) | |
tree | 661d65996ed6dcec7487a72ef6c0d0ac769024d0 /src/leap/bitmask/vpn/_control.py | |
parent | abf688c7d643b89a1001a9f7c7ff24a4a3dab42c (diff) |
[bug] fix attribute error when vpn is not started
Diffstat (limited to 'src/leap/bitmask/vpn/_control.py')
-rw-r--r-- | src/leap/bitmask/vpn/_control.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/leap/bitmask/vpn/_control.py b/src/leap/bitmask/vpn/_control.py index ac683a2a..45d2f2f4 100644 --- a/src/leap/bitmask/vpn/_control.py +++ b/src/leap/bitmask/vpn/_control.py @@ -119,11 +119,13 @@ class VPNControl(object): # We assume that the only valid stops are initiated # by an user action, not hard restarts self._user_stopped = not restart - self._vpnproc.restarting = restart + if self._vpnproc is not None: + self._vpnproc.restarting = restart self._stop_pollers() try: - self._vpnproc.preDown() + if self._vpnproc is not None: + self._vpnproc.preDown() except Exception as e: self.log.error('Error on vpn pre-down {0!r}'.format(e)) raise |