diff --git a/lib/utils/version.js b/lib/utils/version.js index d691807..6a8cf86 100644 --- a/lib/utils/version.js +++ b/lib/utils/version.js @@ -88,7 +88,7 @@ define(function () { rb = parseB.exec(b); } if (!ra && rb) { // rb doesn't get exec-ed when ra == null - return (parseB.exec(b)[1].split('')[0] === '~') ? 1 : -1; + return (rb.length > 0 && rb[1].split('')[0] === '~') ? 1 : -1; } else if (ra && !rb) { return (ra[1].split('')[0] === '~') ? -1 : 1; }