From e30d15ea4a1276345d8ef7691bf3d2d83a8c302f Mon Sep 17 00:00:00 2001 From: neodarz Date: Sun, 31 Jan 2021 22:47:15 +0100 Subject: Raise an error if no token when trying to refresh --- pyfunkwhale/client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyfunkwhale/client.py b/pyfunkwhale/client.py index bebb271..7343e94 100644 --- a/pyfunkwhale/client.py +++ b/pyfunkwhale/client.py @@ -113,6 +113,8 @@ class Client(object): Check if the token is expired in 60 seconds and if True will ask a new token from the instance. """ + if self.token is None: + raise InvalidTokenError(self) if time() - 60 > self.token["expires_at"]: try: self.token = self.oauth_client.refresh_token( -- cgit v1.2.1