From 6dc65a491215e5be0503e4878197035940e5a6a8 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 1 Oct 2021 13:43:33 +0200 Subject: [PATCH] Fix crash with login Fixes CURA-2N2 --- cura/OAuth2/AuthorizationService.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cura/OAuth2/AuthorizationService.py b/cura/OAuth2/AuthorizationService.py index 9bff497c17..291845fd78 100644 --- a/cura/OAuth2/AuthorizationService.py +++ b/cura/OAuth2/AuthorizationService.py @@ -99,7 +99,14 @@ class AuthorizationService: # If no auth data exists, we should always log in again. Logger.log("d", "There was no auth data or access token") return None - user_data = self._auth_helpers.parseJWT(self._auth_data.access_token) + + try: + user_data = self._auth_helpers.parseJWT(self._auth_data.access_token) + except AttributeError: + # THis might seem a bit double, but we get crash reports about this (CURA-2N2 in sentry) + Logger.log("d", "There was no auth data or access token") + return None + if user_data: # If the profile was found, we return it immediately. return user_data