Skip to content
This repository was archived by the owner on May 3, 2026. It is now read-only.

Commit 87f94af

Browse files
committed
fix: return None in get_amd_igpu_name when xrandr call fails
If xrandr exits with a non-zero code the except block logged a warning but execution fell through to the pattern.findall() call, where xrandr_output was never assigned, causing an immediate NameError crash. Return None explicitly so callers receive the expected sentinel value.
1 parent cbfa94b commit 87f94af

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

envycontrol.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@ def get_amd_igpu_name():
470470
except subprocess.CalledProcessError:
471471
logging.warning(
472472
"Failed to run the 'xrandr' command.")
473+
return None
473474

474475
pattern = re.compile(r'(name:).*(ATI*|AMD*|AMD\/ATI)*')
475476

0 commit comments

Comments
 (0)