Skip to content

Commit a4d86ae

Browse files
committed
Check if game exists before grabbing apworld version
1 parent 5f5d4ec commit a4d86ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Patch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ def create_rom_file(patch_file: str) -> Tuple[RomMeta, str]:
2424
if auto_handler:
2525
handler: APAutoPatchInterface = auto_handler(patch_file)
2626
handler.read()
27-
game_version = AutoWorldRegister.world_types[handler.game].world_version
28-
if handler.world_version and game_version != handler.world_version:
27+
game_version = AutoWorldRegister.world_types[handler.game].world_version if handler.game else None
28+
if game_version and handler.world_version and game_version != handler.world_version:
2929
info_msg = "This patch was generated with " \
3030
f"{handler.game} version {handler.world_version.as_simple_string()}, " \
3131
f"but its currently installed version is {game_version.as_simple_string()}. " \

0 commit comments

Comments
 (0)