fix of bug that crashes the meshcentral when there is only digits and one comma on the version of the amt

This commit is contained in:
bennyc-huji 2022-11-08 11:18:08 +02:00 committed by GitHub
parent e189d6785c
commit da604d6bc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -362,8 +362,8 @@ module.exports.CreateAmtScanner = function (parent) {
if (oldVer == newVer) return false; // Versions are same already, don't update.
if (newVer == undefined || newVer == null) return false; // New version is bad, don't update it.
if (oldVer == undefined || oldVer == null) return true; // Old version is no good anyway, update it.
var oldVerArr = oldVer.split('.');
var newVerArr = newVer.split('.');
var oldVerArr = oldVer.toString().split('.');
var newVerArr = newVer.toString().split('.');
if ((oldVerArr.length < 2) || (newVerArr.length < 2)) return false;
if ((oldVerArr[0] != newVerArr[0]) || (oldVerArr[1] != newVerArr[1])) return true;
if (newVerArr.length > oldVerArr.length) return true;