diff --git a/lib/providers/secret_storage.dart b/lib/providers/secret_storage.dart index 077d1cd..b74d515 100644 --- a/lib/providers/secret_storage.dart +++ b/lib/providers/secret_storage.dart @@ -41,8 +41,10 @@ abstract class SecretStorage { Future delete(String key); /// Write [value] at [key] in storage. + /// + /// Throws [SecretStorageException] if no password exist in storage to compare with. /// - /// Throws [SecretStorageException] if [kIsWeb] and neither [setPassword] or [unlock] has been called then [SecretStorageError.encryptedBoxNotOpened] + /// If [kIsWeb] and neither [setPassword] or [unlock] has been called then [SecretStorageError.encryptedBoxNotOpened] /// is returned in exception. Future set(String key, String value); @@ -87,7 +89,8 @@ class MobileSecretStorage extends SecretStorage { @override Future set(String key, String value) async { - return storage.write(key: key, value: value); + await _validatePasswordPresent(); + return await storage.write(key: key, value: value); } @override