Typeof returns a string

This commit is contained in:
JC Brand 2013-11-12 08:17:40 +02:00
parent 84e28a33b8
commit f90fa641b8

View File

@ -451,7 +451,7 @@
var pass = converse.connection.pass; var pass = converse.connection.pass;
var pass_check = this.get('pass_check'); var pass_check = this.get('pass_check');
var result, key; var result, key;
if (saved_key && instance_tag && typeof pass_check !== undefined) { if (saved_key && instance_tag && typeof pass_check !== 'undefined') {
var decrypted = cipher.decrypt(crypto.algo.AES, saved_key, pass); var decrypted = cipher.decrypt(crypto.algo.AES, saved_key, pass);
key = otr.DSA.parsePrivate(decrypted.toString(crypto.enc.Latin1)); key = otr.DSA.parsePrivate(decrypted.toString(crypto.enc.Latin1));
if (cipher.decrypt(crypto.algo.AES, pass_check, pass).toString(crypto.enc.Latin1) === 'match') { if (cipher.decrypt(crypto.algo.AES, pass_check, pass).toString(crypto.enc.Latin1) === 'match') {