diff --git a/core/src/main/resources/lib/form/select/select.js b/core/src/main/resources/lib/form/select/select.js index 8d0a7a51d651..e4bf8c66b63a 100644 --- a/core/src/main/resources/lib/form/select/select.js +++ b/core/src/main/resources/lib/form/select/select.js @@ -5,9 +5,14 @@ function updateListBox(listBox,url,config) { config = object(config); var originalOnSuccess = config.onSuccess; var l = $(listBox); - var status = findFollowingTR(listBox, "validation-error-area").firstChild.nextSibling; - if (status.firstChild && status.firstChild.getAttribute('data-select-ajax-error')) { - status.innerHTML = ""; + var status; + try { + status = findFollowingTR(listBox, "validation-error-area").firstChild.nextSibling; + if (status.firstChild && status.firstChild.getAttribute('data-select-ajax-error')) + status.innerHTML = ""; + } + catch(e) { + console.log(e); } config.onSuccess = function (rsp) { l.removeClassName("select-ajax-pending"); @@ -98,4 +103,4 @@ Behaviour.specify("SELECT.select", 'select', 1000, function(e) { } }); }); -}); +}); \ No newline at end of file diff --git a/war/src/main/webapp/scripts/hudson-behavior.js b/war/src/main/webapp/scripts/hudson-behavior.js index 5b98df43e78b..72e0a5391e2d 100644 --- a/war/src/main/webapp/scripts/hudson-behavior.js +++ b/war/src/main/webapp/scripts/hudson-behavior.js @@ -306,12 +306,10 @@ function findFollowingTR(input, className) { var tr = input; while (tr.tagName != "TR") tr = tr.parentNode; - // then next TR that matches the CSS do { tr = $(tr).next(); } while (tr != null && (tr.tagName != "TR" || !Element.hasClassName(tr,className))); - return tr; } @@ -3053,4 +3051,4 @@ var notificationBar = { if (!options.sticky) this.token = window.setTimeout(function(){self.hide();},this.DELAY); } -}; +}; \ No newline at end of file