js: fixed empty operation setter in Message
authorMaximilian Krambach <maximilian.krambach@intevation.de>
Fri, 27 Apr 2018 08:21:13 +0000 (10:21 +0200)
committerMaximilian Krambach <maximilian.krambach@intevation.de>
Fri, 27 Apr 2018 08:21:13 +0000 (10:21 +0200)
--

* src/Message.js Messages failed because they were not assigned
  operations

lang/js/src/Message.js

index 9e7a883..95d043b 100644 (file)
@@ -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;
     }