From 4628cf82a71ad0a4f63f521098dd58ef88c6a42f Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Wed, 3 Feb 2016 16:23:17 +0000 Subject: [PATCH] Split out response text to its own var to prevent trim() messing up comparisons --- src/vector/updater.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/vector/updater.js b/src/vector/updater.js index b258882fc..a818bd3f7 100644 --- a/src/vector/updater.js +++ b/src/vector/updater.js @@ -29,12 +29,13 @@ module.exports = { if (!req.responseText) { return; } + var ver = req.responseText.trim(); if (!currentVersion) { - currentVersion = req.responseText.trim(); + currentVersion = ver; } - if (req.responseText !== latestVersion) { - latestVersion = req.responseText.trim(); + if (ver !== latestVersion) { + latestVersion = ver; if (module.exports.hasNewVersion()) { console.log("Current=%s Latest=%s", currentVersion, latestVersion); listener(currentVersion, latestVersion);