浏览代码

Check for empty string as well

Vishnu Mohandas 4 年之前
父节点
当前提交
be8d375b79
共有 1 个文件被更改,包括 3 次插入1 次删除
  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);
     }