瀏覽代碼

fix: can not test custom tool (#15606)

非法操作 1 月之前
父節點
當前提交
5019547d33
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      api/models/tools.py

+ 2 - 0
api/models/tools.py

@@ -102,6 +102,8 @@ class ApiToolProvider(Base):
 
     @property
     def user(self) -> Account | None:
+        if not self.user_id:
+            return None
         return db.session.query(Account).filter(Account.id == self.user_id).first()
 
     @property