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.
This commit is contained in:
parent
59ed27bae1
commit
94a0ed361e
@ -87,9 +87,12 @@ class GPGME_Signature {
|
|||||||
constructor (sigObject){
|
constructor (sigObject){
|
||||||
this._rawSigObject = sigObject;
|
this._rawSigObject = sigObject;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @returns {String} the fingerprint of this signature
|
||||||
|
*/
|
||||||
get fingerprint (){
|
get fingerprint (){
|
||||||
if (!this._rawSigObject.fingerprint){
|
if (!this._rawSigObject.fingerprint){
|
||||||
return gpgme_error('SIG_WRONG');
|
throw gpgme_error('SIG_WRONG');
|
||||||
} else {
|
} else {
|
||||||
return this._rawSigObject.fingerprint;
|
return this._rawSigObject.fingerprint;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user