소스 검색

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);
     }