js: wrong object assumed in recent commit

--

* 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.
This commit is contained in:
Maximilian Krambach 2018-08-16 12:13:10 +02:00
parent 715cdc0d7d
commit 43cff51364

View 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'));