Don't crash if the keyring password cannot be decoded

Fixes Sentry issue CURA-2S0
This commit is contained in:
Konstantinos Karmas 2021-08-11 17:25:45 +02:00
parent 0e26b9125a
commit 7c8153eede

View file

@ -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)