From c68ed3ab49c13da00c41b9d1493122237f23c693 Mon Sep 17 00:00:00 2001 From: equations19 Date: Sun, 30 Aug 2026 22:05:32 -0500 Subject: [PATCH] Prevent possible None dereferences in texture recoloring --- Module/cosmeticsmods/texture.py | 4 ++-- UI/Submenus/TextureRecolorSettingsDialog.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Module/cosmeticsmods/texture.py b/Module/cosmeticsmods/texture.py index a503eb2f..3e1a324d 100644 --- a/Module/cosmeticsmods/texture.py +++ b/Module/cosmeticsmods/texture.py @@ -330,8 +330,8 @@ def recolor_textures(self) -> list[ModAsset]: return assets base_path = appconfig.extracted_game_path("kh2") - if not base_path.is_dir(): - print(f"Could not find extracted data at {base_path} - not recoloring textures") + if base_path is None: + print(f"Could not find extracted KH2 game data - not recoloring textures") return assets recolorable_models = self.load_recolorable_models() diff --git a/UI/Submenus/TextureRecolorSettingsDialog.py b/UI/Submenus/TextureRecolorSettingsDialog.py index b100b556..95ce76d6 100644 --- a/UI/Submenus/TextureRecolorSettingsDialog.py +++ b/UI/Submenus/TextureRecolorSettingsDialog.py @@ -43,9 +43,9 @@ def __init__(self, seed_settings: SeedSettings): self.conditions_loader = TextureConditionsLoader() self.base_path = appconfig.extracted_game_path("kh2") - if not self.base_path.is_dir(): + if self.base_path is None: # Really shouldn't be able to get here without something weird going on, just note it and return - print(f"Could not find extracted data at {self.base_path}") + print(f"Could not find extracted KH2 game data") return all_models = TextureRecolorizer.load_recolorable_models()