From 719255891e543d15720b6bdeb293621266618efc Mon Sep 17 00:00:00 2001 From: Justus Lind Date: Thu, 21 Nov 2024 00:20:35 +1000 Subject: [PATCH] Swap to explicit key error --- worlds/musedash/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/worlds/musedash/__init__.py b/worlds/musedash/__init__.py index be2eec2f87..734616ab40 100644 --- a/worlds/musedash/__init__.py +++ b/worlds/musedash/__init__.py @@ -183,8 +183,10 @@ class MuseDashWorld(World): if album: return MuseDashSongItem(name, self.player, album) - song = self.md_collection.song_items[name] - return MuseDashSongItem(name, self.player, song) + song = self.md_collection.song_items.get(name) + if song: + return MuseDashSongItem(name, self.player, song) + raise KeyError(name) def get_filler_item_name(self) -> str: return self.random.choices(self.filler_item_names, self.filler_item_weights)[0]