Explorar o código

Check for empty string as well

Vishnu Mohandas %!s(int64=4) %!d(string=hai) anos
pai
achega
be8d375b79
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      lib/ui/settings_page.dart

+ 3 - 1
lib/ui/settings_page.dart

@@ -454,7 +454,9 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
 
   Future<String> _getOrCreateRecoveryKey() async {
     final key = _config.getKey();
-    if (_config.getKeyAttributes().recoveryKeyEncryptedWithMasterKey == null) {
+    final encryptedRecoveryKey =
+        _config.getKeyAttributes().recoveryKeyEncryptedWithMasterKey;
+    if (encryptedRecoveryKey == null || encryptedRecoveryKey.isEmpty) {
       final keyAttributes = await _config.createNewRecoveryKey();
       await UserService.instance.setRecoveryKey(keyAttributes);
     }