Skip to content

Commit

Permalink
Fix an issue with rebirthing trying to jsonify a NoneType (#461)
Browse files Browse the repository at this point in the history
  • Loading branch information
TrustyJAID authored Apr 23, 2024
1 parent dd5230b commit e863ac3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion adventure/charsheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -1577,8 +1577,10 @@ async def rebirth(self, dev_val: int = None) -> dict:
if item and item.to_json() not in list(self.pieces_to_keep.values()):
await self.add_to_backpack(item)
if (self.left and self.left.slot is Slot.two_handed) or (self.right and self.right.slot is Slot.two_handed):
if self.left.to_json() not in list(self.pieces_to_keep.values()):
if self.left and self.left.to_json() not in list(self.pieces_to_keep.values()):
await self.add_to_backpack(self.left)
elif self.right and self.right.to_json() not in list(self.pieces_to_keep.values()):
await self.add_to_backpack(self.right)
else:
for item in [self.left, self.right]:
if item and item.to_json() not in list(self.pieces_to_keep.values()):
Expand Down

0 comments on commit e863ac3

Please sign in to comment.