kdk_handler: Verify path before iterating over

This commit is contained in:
Mykola Grymalyuk
2022-09-30 11:18:11 -06:00
parent 7e006e8722
commit 9c18b15153
2 changed files with 7 additions and 5 deletions

View File

@@ -2446,7 +2446,8 @@ class wx_python_gui:
self.gpu_dropdown.Bind(wx.EVT_CHOICE, self.gpu_selection_click)
self.gpu_dropdown.Centre(wx.HORIZONTAL)
self.gpu_dropdown.SetToolTip(wx.ToolTip("Configures MXM GPU Vendor logic on pre-built models\nIf you are not using MXM iMacs, please leave this setting as is."))
if self.computer.real_model not in ["iMac10,1", "iMac11,1", "iMac11,2", "iMac11,3", "iMac12,1", "iMac12,2"]:
models = ["iMac10,1", "iMac11,1", "iMac11,2", "iMac11,3", "iMac12,1", "iMac12,2"]
if (not self.constants.custom_model and self.computer.real_model not in models) or (self.constants.custom_model and self.constants.custom_model not in models):
self.gpu_dropdown.Disable()
# Disable Thunderbolt

View File

@@ -170,8 +170,9 @@ class kernel_debug_kit_handler:
return False, error_msg
def is_kdk_installed(self, build):
for file in Path("/Library/Developer/KDKs").iterdir():
if file.is_dir():
if build in file.name:
return True
if Path("/Library/Developer/KDKs").exists():
for file in Path("/Library/Developer/KDKs").iterdir():
if file.is_dir():
if build in file.name:
return True
return False