From 7721a0ff4e42838698ae2ee45f79d7d14741d2c2 Mon Sep 17 00:00:00 2001 From: Herbert Poul Date: Sun, 23 May 2021 23:05:53 +0200 Subject: [PATCH] allow password of composite key be nullable. --- lib/src/kdbx_format.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/kdbx_format.dart b/lib/src/kdbx_format.dart index 1d100f2..1fae647 100644 --- a/lib/src/kdbx_format.dart +++ b/lib/src/kdbx_format.dart @@ -31,9 +31,9 @@ final _logger = Logger('kdbx.format'); abstract class Credentials { factory Credentials(ProtectedValue password) => Credentials.composite(password, null); //PasswordCredentials(password); - factory Credentials.composite(ProtectedValue password, Uint8List? keyFile) => + factory Credentials.composite(ProtectedValue? password, Uint8List? keyFile) => KeyFileComposite( - password: PasswordCredentials(password), + password: password?.let((that) => PasswordCredentials(that)), keyFile: keyFile == null ? null : KeyFileCredentials(keyFile), );