fixed crash on empty wi-fi list

netiawifi
selfisekai 2020-09-05 01:55:38 +02:00
parent b05b3832ec
commit 58fb0a63b9
1 changed files with 5 additions and 1 deletions

View File

@ -11,9 +11,13 @@ class NetworkManagerConnector:
capture_output=True, text=True)
if parse:
# if no output
if subp.stdout.strip() == "":
return []
return [
[field.replace("\\:", ":")
for field in re.split(r"(?<!\\):", line)]
for field in re.split(r"(?<!\\):", line)]
for line in subp.stdout.strip().split("\n")]
return subp.stdout