From f48971a0c4a10da35101abacce05fe95d4d1a9a0 Mon Sep 17 00:00:00 2001 From: snowy Date: Tue, 4 Jun 2024 18:00:38 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20orm=E6=A1=86=E6=9E=B6=E5=9C=A8=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=E5=AD=97=E6=AE=B5=E5=80=BC=E6=97=B6=E9=81=87=E5=88=B0?= =?UTF-8?q?None=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- liteyuki/utils/base/data.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/liteyuki/utils/base/data.py b/liteyuki/utils/base/data.py index 5cf73636..e5e33098 100644 --- a/liteyuki/utils/base/data.py +++ b/liteyuki/utils/base/data.py @@ -154,8 +154,11 @@ class Database: field: str if field.startswith(self.BYTES_PREFIX): - - 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 + if isinstance(value, bytes): + 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):