This commit is contained in:
jxxghp
2024-05-17 07:46:27 +08:00
parent 92cdd67f3a
commit 278835c5d4
2 changed files with 3 additions and 2 deletions

View File

@ -228,7 +228,7 @@ class DoubanApi(metaclass=Singleton):
ua=settings.USER_AGENT,
session=self._session,
).post_res(url=req_url, data=params)
if resp.status_code == 400 and "rate_limit" in resp.text:
if resp is not None and resp.status_code == 400 and "rate_limit" in resp.text:
return resp.json()
return resp.json() if resp else {}