diff --git a/CHANGELOG.md b/CHANGELOG.md index f57f8113c..aede60371 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Ensure Apple Silicon-specific installers are not listed - ie. M2 specific build (21F2092) - Avoid adding OpenCore icon in boot picker if Windows bootloader on same partition +- Add error-handling to corrupt/non-standard NVRAM variables ## 0.4.7 - Fix crashing on defaults parsing diff --git a/resources/utilities.py b/resources/utilities.py index f81a73a76..71d3864dd 100644 --- a/resources/utilities.py +++ b/resources/utilities.py @@ -346,7 +346,12 @@ def get_nvram(variable: str, uuid: str = None, *, decode: bool = False): if decode: if isinstance(value, bytes): - value = value.strip(b"\0").decode() + try: + value = value.strip(b"\0").decode() + except UnicodeDecodeError: + # Some sceanrios the firmware will throw garbage in + # ie. iMac12,2 with FireWire boot-path + value = None elif isinstance(value, str): value = value.strip("\0") return value