From 174c773cbc2fbfdf1471b58853b4b5d409f75a47 Mon Sep 17 00:00:00 2001 From: Hoang Hong Quan Date: Fri, 11 Oct 2024 11:00:51 +0700 Subject: [PATCH] Add sound info check before proceeding Fixes #9 --- Scripts/config_prodigy.py | 7 ++++--- Scripts/kext_maestro.py | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Scripts/config_prodigy.py b/Scripts/config_prodigy.py index f051b2b..42e65e9 100644 --- a/Scripts/config_prodigy.py +++ b/Scripts/config_prodigy.py @@ -373,9 +373,10 @@ class ConfigProdigy: "keepsyms=1" ] - codec_id = list(hardware_report.get("Sound").items())[0][-1].get("Device ID") - if codec_id in codec_layouts.data: - boot_args.append("alcid={}".format(random.choice(codec_layouts.data.get(codec_id)))) + if hardware_report.get("Sound"): + codec_id = list(hardware_report.get("Sound").items())[0][-1].get("Device ID") + if codec_id in codec_layouts.data: + boot_args.append("alcid={}".format(random.choice(codec_layouts.data.get(codec_id)))) if "AMD" in hardware_report.get("CPU").get("Manufacturer") or self.is_intel_hedt_cpu(hardware_report.get("CPU").get("Codename")): boot_args.append("npci=0x2000") diff --git a/Scripts/kext_maestro.py b/Scripts/kext_maestro.py index 90b7f54..75a1cb3 100644 --- a/Scripts/kext_maestro.py +++ b/Scripts/kext_maestro.py @@ -116,8 +116,9 @@ class KextMaestro: self.utils.parse_darwin_version(macos_version) >= self.utils.parse_darwin_version("23.0.0") or "MacPro7,1" in smbios_model: selected_kexts.append("RestrictEvents") - if list(hardware_report.get("Sound").items())[0][-1].get("Device ID") in codec_layouts.data: - selected_kexts.append("AppleALC") + if hardware_report.get("Sound"): + if list(hardware_report.get("Sound").items())[0][-1].get("Device ID") in codec_layouts.data: + selected_kexts.append("AppleALC") if "AMD" in hardware_report.get("CPU").get("Manufacturer") and self.utils.parse_darwin_version(macos_version) >= self.utils.parse_darwin_version("21.4.0") or \ int(hardware_report.get("CPU").get("CPU Count")) > 1 and self.utils.parse_darwin_version(macos_version) >= self.utils.parse_darwin_version("19.0.0"):