js: fixed empty operation setter in Message

--

* src/Message.js Messages failed because they were not assigned
  operations
This commit is contained in:
Maximilian Krambach 2018-04-27 10:21:13 +02:00
parent f45b926816
commit eb7129f319

View File

@ -44,9 +44,16 @@ export class GPGME_Message {
} }
set operation (op){ 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(){ get operation(){
return this._msg.op; return this._msg.op;
} }