From eb7129f3196ae4f0807ceba0c1fc9e818ea6cd22 Mon Sep 17 00:00:00 2001 From: Maximilian Krambach Date: Fri, 27 Apr 2018 10:21:13 +0200 Subject: [PATCH] js: fixed empty operation setter in Message -- * src/Message.js Messages failed because they were not assigned operations --- lang/js/src/Message.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lang/js/src/Message.js b/lang/js/src/Message.js index 9e7a8835..95d043ba 100644 --- a/lang/js/src/Message.js +++ b/lang/js/src/Message.js @@ -44,9 +44,16 @@ export class GPGME_Message { } set operation (op){ - - + if (typeof(op) === "string"){ + if (!this._msg){ + this._msg = {}; + } + if (!this._msg.op & permittedOperations.hasOwnProperty(op)){ + this._msg.op = op; + } + } } + get operation(){ return this._msg.op; }