From 0d402c4dba376cf09f258f4ac8335479ebb172bb Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Tue, 14 Dec 2021 17:16:33 -0700 Subject: [PATCH] Fix crashing on unknown SMBIOS --- resources/defaults.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/resources/defaults.py b/resources/defaults.py index 822b5929e..0be8fd68f 100644 --- a/resources/defaults.py +++ b/resources/defaults.py @@ -103,12 +103,15 @@ class generate_defaults: # Native Macs (mainly M1s) will error out as they don't know what SMBIOS to spoof to # As we don't spoof on native models, we can safely ignore this spoof_model = model - if smbios_data.smbios_dictionary[spoof_model]["SecureBootModel"] is not None: - if settings.sip_status is False: - # Force VMM as root patching breaks .im4m signature - settings.secure_status = False - settings.force_vmm = True - else: - # Allow SecureBootModel - settings.secure_status = True - settings.force_vmm = False + try: + if smbios_data.smbios_dictionary[spoof_model]["SecureBootModel"] is not None: + if settings.sip_status is False: + # Force VMM as root patching breaks .im4m signature + settings.secure_status = False + settings.force_vmm = True + else: + # Allow SecureBootModel + settings.secure_status = True + settings.force_vmm = False + except KeyError: + pass