Skip to content

Commit

Permalink
fix(modules/nic): handle missing wireless strength info gracefully
Browse files Browse the repository at this point in the history
if unable to read wireless signal strength -> show an error

fixes #1029
  • Loading branch information
tobi-wan-kenobi committed Dec 18, 2024
1 parent a882fb9 commit a8da83f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bumblebee_status/modules/core/nic.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import shutil
import netifaces
import subprocess
import os

import core.module
import core.decorators
Expand Down Expand Up @@ -177,6 +178,8 @@ def get_ssid(self, intf):
def get_strength_dbm(self, intf):
if not self._iswlan(intf) or self._istunnel(intf) or not self.iw:
return None
if not os.path.isfile("/proc/net/wireless"):
return None

with open("/proc/net/wireless", "r") as file:
for line in file:
Expand Down

0 comments on commit a8da83f

Please sign in to comment.