From e863ac36faa29ca46faebcb22af87de39d123a25 Mon Sep 17 00:00:00 2001 From: TrustyJAID Date: Mon, 22 Apr 2024 21:31:50 -0600 Subject: [PATCH] Fix an issue with rebirthing trying to jsonify a NoneType (#461) --- adventure/charsheet.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/adventure/charsheet.py b/adventure/charsheet.py index dc400195..6f09edc4 100644 --- a/adventure/charsheet.py +++ b/adventure/charsheet.py @@ -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()):