js: wrong object assumed in recent commit
authorMaximilian Krambach <maximilian.krambach@intevation.de>
Thu, 16 Aug 2018 10:13:10 +0000 (12:13 +0200)
committerMaximilian Krambach <maximilian.krambach@intevation.de>
Thu, 16 Aug 2018 10:13:10 +0000 (12:13 +0200)
--

* src/Keyring.js I wrongly assumed an object to be a GPGME_Key,
  it was the raw answer from nativeMessaging instead. Now it returns
  a GPGME_Key again.

lang/js/src/Keyring.js

index 9fdd53b..93923c6 100644 (file)
@@ -200,8 +200,11 @@ export class GPGME_Keyring {
                                 reject(gpgme_error('KEY_NO_DEFAULT'));
                             } else {
                                 for (let i=0; i< result.keys.length; i++ ) {
-                                    if (result.keys[i].get('invalid') === false) {
-                                        resolve(result.keys[i]);
+                                    if (result.keys[i].invalid === false) {
+                                        let k = createKey(
+                                            result.keys[i].fingerprint);
+                                        k.setKeyData(result.keys[i]);
+                                        resolve(k);
                                         break;
                                     } else if (i === result.keys.length - 1){
                                         reject(gpgme_error('KEY_NO_DEFAULT'));