Browse Source

Check for empty string as well

Vishnu Mohandas 4 years ago
parent
commit
be8d375b79
1 changed files with 3 additions and 1 deletions
  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);
     }