Bug 1552177 - Follow-up: Fix check for array length. r=mkmelin
authorKai Engert <kaie@kuix.de>
Wed, 05 Jun 2019 18:45:52 +0200
changeset 35778 911d98783d650cb83d15920c07046df8411834c1
parent 35777 4a37dadf68195123ad4e38b39487a64c15f28d18
child 35779 fdc11cc835350decbe04c6def58bfbd1c1dbf8d9
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersmkmelin
bugs1552177
Bug 1552177 - Follow-up: Fix check for array length. r=mkmelin
chat/modules/OTRUI.jsm
--- a/chat/modules/OTRUI.jsm
+++ b/chat/modules/OTRUI.jsm
@@ -192,17 +192,17 @@ var OTRUI = {
 
   reportKeyGenFailure(param) {
     throw new Error(_strArgs("otr-genkey-failed", {error: String(param)}));
   },
 
   accountsToGenKey: [],
 
   genNextMissingKey() {
-    if (!OTRUI.accountsToGenKey) {
+    if (OTRUI.accountsToGenKey.length == 0) {
       return;
     }
 
     let acc = OTRUI.accountsToGenKey.pop();
     let fp = OTR.privateKeyFingerprint(acc.name, acc.prot);
     if (!fp) {
       OTR.generatePrivateKey(acc.name, acc.prot)
       .then(OTRUI.loopKeyGenSuccess, OTRUI.loopKeyGenFailure);