From 64138a37c7b61f640560d947b91410b005858e6b Mon Sep 17 00:00:00 2001 From: Ayham Kteash Date: Wed, 10 Jan 2024 11:13:45 +0100 Subject: [PATCH] fix: throw error if salt is not defined --- src/type/s2k/generic.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/type/s2k/generic.ts b/src/type/s2k/generic.ts index 858969a7..e3a4f54e 100644 --- a/src/type/s2k/generic.ts +++ b/src/type/s2k/generic.ts @@ -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);