extensionUtils: Check version variable for undefined first

Avoid a warning message when trying to access requiredArray[2] by
checking if its undefined first.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/96
This commit is contained in:
Jonas Dreßler 2018-11-19 12:26:16 +01:00 committed by Florian Müllner
parent d2ead59d74
commit 8754736fda

View File

@ -165,8 +165,8 @@ function versionCheck(required, current) {
let requiredArray = required[i].split('.');
if (requiredArray[0] == major &&
requiredArray[1] == minor &&
(requiredArray[2] == point ||
(requiredArray[2] == undefined && parseInt(minor) % 2 == 0)))
((requiredArray[2] === undefined && parseInt(minor) % 2 == 0) ||
requiredArray[2] == point))
return true;
}
return false;