From 94a0ed361ea04c2a0a2e144877b0e17b9fea35a2 Mon Sep 17 00:00:00 2001 From: Maximilian Krambach Date: Wed, 22 Aug 2018 14:49:11 +0200 Subject: [PATCH] js: Return error if signature has no fingerprint -- * src/Signature.js/get fingerprint: A signature with no fingerprint should not happen, but if it does, we should throw an error here, as the method is a getter. --- lang/js/src/Signature.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lang/js/src/Signature.js b/lang/js/src/Signature.js index a6539048..530590f9 100644 --- a/lang/js/src/Signature.js +++ b/lang/js/src/Signature.js @@ -87,9 +87,12 @@ class GPGME_Signature { constructor (sigObject){ this._rawSigObject = sigObject; } + /** + * @returns {String} the fingerprint of this signature + */ get fingerprint (){ if (!this._rawSigObject.fingerprint){ - return gpgme_error('SIG_WRONG'); + throw gpgme_error('SIG_WRONG'); } else { return this._rawSigObject.fingerprint; }