fix: throw error if salt is not defined

This commit is contained in:
Ayham Kteash 2024-01-10 11:13:45 +01:00
parent 221cb45be8
commit 64138a37c7
No known key found for this signature in database
GPG Key ID: 830C24645F048DB3

View File

@ -121,7 +121,8 @@ class GenericS2K {
case 'simple':
break;
case 'salted':
this.salt && arr.push(this.salt);
if (!this.salt) { throw Error('Salt was not set') }
arr.push(this.salt);
break;
case 'iterated':
this.salt &&arr.push(this.salt);