Skip to content

Commit

Permalink
🎨 Fix KeyError caused by failure to retrieve affixMap
Browse files Browse the repository at this point in the history
  • Loading branch information
luoshuijs committed Nov 8, 2023
1 parent f0b2155 commit 4de68b5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python_genshin_artifact/enka/enka_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ def de_equip_list(equip_list: list[dict]) -> Tuple[WeaponInterface, List[Artifac
if weapon_name is None:
raise EnkaParseException(f"weapon_id={weapon_id} is not found in assets")
_level = _weapon["level"]
refinement_level = next(iter(_weapon["affixMap"].values())) + 1
affix_map = _weapon.get("affixMap")
refinement_level = 0
if affix_map is not None:
refinement_level = next(iter(affix_map.values())) + 1
_promote_level = _weapon.get("promoteLevel")
ascend = False
if _promote_level is not None:
Expand Down

0 comments on commit 4de68b5

Please sign in to comment.