ソースを参照

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