Skip to content

Commit

Permalink
[JENKINS-42228] - Prevent JavaScript error on the Jenkins system conf…
Browse files Browse the repository at this point in the history
…iguration page (#4889)

* Prevent potential access violation

* Add a warning log
  • Loading branch information
takashiharano committed Aug 3, 2020
1 parent 97c7b68 commit 0ae7f81
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion war/src/main/webapp/scripts/hudson-behavior.js
Expand Up @@ -500,7 +500,12 @@ var tooltip;
//========================================================
// using tag names in CSS selector makes the processing faster
function registerValidator(e) {
e.targetElement = findFollowingTR(e, "validation-error-area").firstChild.nextSibling;
var tr = findFollowingTR(e, "validation-error-area");
if (!tr || !tr.firstChild) {
console.warn("Couldn't register validator, start element was", e);
return;
}
e.targetElement = tr.firstChild.nextSibling;
e.targetUrl = function() {
var url = this.getAttribute("checkUrl");
var depends = this.getAttribute("checkDependsOn");
Expand Down

0 comments on commit 0ae7f81

Please sign in to comment.