Browse Source

Don't crash if the keyring password cannot be decoded

Fixes Sentry issue CURA-2S0
Konstantinos Karmas 3 years ago
parent
commit
7c8153eede
1 changed files with 4 additions and 0 deletions
  1. 4 0
      cura/OAuth2/KeyringAttribute.py

+ 4 - 0
cura/OAuth2/KeyringAttribute.py

@@ -43,6 +43,10 @@ class KeyringAttribute:
                 self._store_secure = False
                 Logger.log("i", "Access to the keyring was denied.")
                 return getattr(instance, self._name)
+            except UnicodeDecodeError:
+                self._store_secure = False
+                Logger.log("w", "The password retrieved from the keyring cannot be used because it contains characters that cannot be decoded.")
+                return getattr(instance, self._name)
         else:
             return getattr(instance, self._name)