From 33271ebeb36235b3a46575686f30ac7d5a3dd489 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Mon, 9 Dec 2024 22:50:24 +0100 Subject: [PATCH] Fix KeyError if find_mod_update_post looks for a modversion in a file that's not an update post --- scripts/add_mod_port.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/add_mod_port.py b/scripts/add_mod_port.py index f5c959e..5428384 100644 --- a/scripts/add_mod_port.py +++ b/scripts/add_mod_port.py @@ -62,7 +62,7 @@ def find_mod_update_post(mod, version): post_path = os.path.join(root, file) front_matter = read_front_matter(post_path) - if front_matter["modversion"] == version: + if front_matter.get("modversion") == version: return front_matter, post_path raise ValueError(f"Could not find post for mod {mod} version {version}")