make memLimit and opsLimit non-nullable and remove null check
This commit is contained in:
parent
51eb2cceff
commit
f2adc32b4b
|
@ -7,8 +7,8 @@ class KeyAttributes {
|
|||
final String publicKey;
|
||||
final String encryptedSecretKey;
|
||||
final String secretKeyDecryptionNonce;
|
||||
final int? memLimit;
|
||||
final int? opsLimit;
|
||||
final int memLimit;
|
||||
final int opsLimit;
|
||||
final String masterKeyEncryptedWithRecoveryKey;
|
||||
final String masterKeyDecryptionNonce;
|
||||
final String recoveryKeyEncryptedWithMasterKey;
|
||||
|
|
|
@ -25,7 +25,7 @@ void validatePreVerificationStateCheck(
|
|||
"secretKeyDecryptionNonce",
|
||||
);
|
||||
nullOrEmptyArgCheck(keyAttr.publicKey, "publicKey");
|
||||
if ((keyAttr.memLimit ?? 0) <= 0 || (keyAttr.opsLimit ?? 0) <= 0) {
|
||||
if (keyAttr.memLimit <= 0 || keyAttr.opsLimit <= 0) {
|
||||
throw ArgumentError("Key mem/OpsLimit can not be null or <0");
|
||||
}
|
||||
// check password encoding issues
|
||||
|
|
Loading…
Reference in a new issue