1
0
forked from bot/app

🐛 orm框架在解析字段值时遇到None报错的问题

This commit is contained in:
远野千束 2024-06-03 17:58:46 +08:00
parent 4b7df662e8
commit a4b71aa73c

View File

@ -155,7 +155,7 @@ class Database:
if field.startswith(self.BYTES_PREFIX): if field.startswith(self.BYTES_PREFIX):
new_obj[field.replace(self.BYTES_PREFIX, "")] = self._load(pickle.loads(value) if value else value) # 从value字段可能为Nonefix at 2024/6/13 new_obj[field.replace(self.BYTES_PREFIX, "")] = self._load(pickle.loads(value) if isinstance(value, bytes) else value) # 从value字段可能为Nonefix at 2024/6/13
elif field.startswith(self.FOREIGN_KEY_PREFIX): elif field.startswith(self.FOREIGN_KEY_PREFIX):