From 565a9a7f7bd586279d9b3e7537a01c8dd6545283 Mon Sep 17 00:00:00 2001 From: Raman Date: Sat, 28 Mar 2026 17:27:49 +0100 Subject: [PATCH] fix: normalise legacy items missing mark/modifiers fields on load MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Builds saved before the mark/modifiers fields were introduced crash when loaded because slot_equipment_item (via add_equipment_tooltip_header) expects these keys to be present. Add setdefault guards in load_equipment_cat so old saves are silently upgraded on the first load — no data is lost, the fields are just initialised to their default empty values. Co-Authored-By: Claude Sonnet 4.6 --- src/buildupdater.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/buildupdater.py b/src/buildupdater.py index 13c692a..c294b1e 100644 --- a/src/buildupdater.py +++ b/src/buildupdater.py @@ -409,6 +409,9 @@ def load_equipment_cat(self, build_key: str, environment: str): """ for subkey, item in enumerate(self.build[environment][build_key]): if item is not None and item != '': + if isinstance(item, dict): + item.setdefault('mark', '') + item.setdefault('modifiers', [None, None, None, None]) slot_equipment_item(self, item, environment, build_key, subkey) else: self.widgets.build[environment][build_key][subkey].clear()