Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-15494

Uncaught TypeError: Cannot read property 'firstChild' of null

      Under some conditions adding a dynamic section to a configuration screen fails with the abovementioned error. In renderOnDemand, c.innerHTML = "<TABLE><TBODY>"+t.responseText+"</TBODY></TABLE>"; succeeds yet immediately afterwards c.firstChild is a HTMLLinkElement rather than the expected HTMLTableElement:

      <link rel="stylesheet" href="/adjuncts/…/lib/form/section_.css" type="text/css">
      

      The second child is indeed the expected table, so something inserted this link element at the top.

      Uri Scheiner says this occurred for him due to <f:advanced> under a separated <f:section>, yet it seems to occur under other circumstances as well.

          [JENKINS-15494] Uncaught TypeError: Cannot read property 'firstChild' of null

          Jesse Glick created issue -
          Jesse Glick made changes -
          Description Original: Under some conditions adding a dynamic section to a configuration screen fails with the abovementioned error. In {{renderOnDemand}}, {{c.innerHTML = "<TABLE><TBODY>"+t.responseText+"</TBODY></TABLE>";}} succeeds yet immediately afterwards {{c.firstChild}} is a {{HTMLLinkElement}} rather than the expected {{HTMLTableElement}}:

          {code:xml}
          <link rel="stylesheet" href="/adjuncts/…/lib/form/section_.css" type="text/css">
          {code}

          The second child is indeed the expected table, so something inserted this link element at the top.

          Uri Scheiner says this occurred for him due to {{<f:advanced>}} under a separated {{<f:section>}}, yet it seems to occur under other circumstances as well.
          New: Under some conditions adding a dynamic section to a configuration screen fails with the abovementioned error. In {{renderOnDemand}}, {{c.innerHTML = "<TABLE><TBODY>"\+t.responseText\+"</TBODY></TABLE>";}} succeeds yet immediately afterwards {{c.firstChild}} is a {{HTMLLinkElement}} rather than the expected {{HTMLTableElement}}:

          {code:xml}
          <link rel="stylesheet" href="/adjuncts/…/lib/form/section_.css" type="text/css">
          {code}

          The second child is indeed the expected table, so something inserted this link element at the top.

          Uri Scheiner says this occurred for him due to {{<f:advanced>}} under a separated {{<f:section>}}, yet it seems to occur under other circumstances as well.
          Jesse Glick made changes -
          Priority Original: Major [ 3 ] New: Critical [ 2 ]
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          Jesse Glick made changes -
          Labels Original: javascript jelly New: 1.480.4-candidate javascript jelly
          Jesse Glick made changes -
          Labels Original: 1.480.4-candidate javascript jelly New: javascript jelly lts-candidate
          vjuranek made changes -
          Labels Original: javascript jelly lts-candidate New: 1.509.1-fixed javascript jelly
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 146250 ] New: JNJira + In-Review [ 191843 ]

            Unassigned Unassigned
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: