Skip to content

Commit 4628cf8

Browse files
committed
Split out response text to its own var to prevent trim() messing up comparisons
1 parent 5eed734 commit 4628cf8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/vector/updater.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,13 @@ module.exports = {
2929
if (!req.responseText) {
3030
return;
3131
}
32+
var ver = req.responseText.trim();
3233
if (!currentVersion) {
33-
currentVersion = req.responseText.trim();
34+
currentVersion = ver;
3435
}
3536

36-
if (req.responseText !== latestVersion) {
37-
latestVersion = req.responseText.trim();
37+
if (ver !== latestVersion) {
38+
latestVersion = ver;
3839
if (module.exports.hasNewVersion()) {
3940
console.log("Current=%s Latest=%s", currentVersion, latestVersion);
4041
listener(currentVersion, latestVersion);

0 commit comments

Comments
 (0)