From cea03a19f3b90a8bc7c0a276f857bf582d99f402 Mon Sep 17 00:00:00 2001 From: megumi.telles Date: Fri, 4 Aug 2017 09:33:17 -0700 Subject: bug: Fix out of range index in dispo controller --- plugins/org.eclipse.osee.web.ui/src/dispo/js/userController.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/org.eclipse.osee.web.ui/src/dispo/js/userController.js b/plugins/org.eclipse.osee.web.ui/src/dispo/js/userController.js index ec57da1fc16..996a4ec5543 100644 --- a/plugins/org.eclipse.osee.web.ui/src/dispo/js/userController.js +++ b/plugins/org.eclipse.osee.web.ui/src/dispo/js/userController.js @@ -146,9 +146,9 @@ app.controller('userController', [ var delta = bSplit[0] - aSplit[0]; if (delta == 0) { - if (bSplit[1].match("RESULT") && !aSplit[1].match("RESULT")) { + if (isValidSize(aSplit, bSplit) && bSplit[1].match("RESULT") && !aSplit[1].match("RESULT")) { return -1; - } else if (!bSplit[1].match("RESULT") && aSplit[1].match("RESULT")) { + } else if (isValidSize(aSplit, bSplit) && !bSplit[1].match("RESULT") && aSplit[1].match("RESULT")) { return 1; } else { return a.locationRefs.localeCompare(b.locationRefs); @@ -158,6 +158,10 @@ app.controller('userController', [ } } } + + var isValidSize = function (a, b) { + return (a.size > 1 && b.size > 1); + } $scope.getSourceFlie = function() { var requst = []; -- cgit v1.2.3