mirror of
https://github.com/LiteyukiStudio/LiteyukiBot.git
synced 2024-11-13 16:47:24 +08:00
🐛 orm框架在解析字段值时遇到None报错的问题
This commit is contained in:
parent
a4b71aa73c
commit
f48971a0c4
@ -154,8 +154,11 @@ class Database:
|
|||||||
field: str
|
field: str
|
||||||
|
|
||||||
if field.startswith(self.BYTES_PREFIX):
|
if field.startswith(self.BYTES_PREFIX):
|
||||||
|
if isinstance(value, bytes):
|
||||||
new_obj[field.replace(self.BYTES_PREFIX, "")] = self._load(pickle.loads(value) if isinstance(value, bytes) else value) # 从value字段可能为None,fix at 2024/6/13
|
new_obj[field.replace(self.BYTES_PREFIX, "")] = self._load(pickle.loads(value))
|
||||||
|
else: # 从value字段可能为None,fix at 2024/6/13
|
||||||
|
pass
|
||||||
|
# 暂时不作处理,后面再修
|
||||||
|
|
||||||
elif field.startswith(self.FOREIGN_KEY_PREFIX):
|
elif field.startswith(self.FOREIGN_KEY_PREFIX):
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user