Bug 1635019 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Running mochitest of FULL DEBUG version of thunderbird
produces the following error.
120 at the beginning of line is the frequencey of occurences.

    120 INFO Console message: [JavaScript Error: "TypeError: can't access property "firstChild", container is undefined" {file: "chrome://messenger/content/customizableui/panelUI.js" line: 1324}]


mozilla/comm/mail/components/customizableui/content/panelUI.js


  updateAlerts() {
    let tabmail = document.getElementById("tabmail");
    let sideloaded = ExtensionsUI.sideloaded;
    let updates = ExtensionsUI.updates;
    let container = PanelUI.addonNotificationContainer;

    while (container.firstChild) {    <=== here
      container.firstChild.remove();
    }


I think the whole while-statement  ought to be enclosed in a if
(conainer) check.

if (container) {
    while (container.firstChild) {
      container.firstChild.remove();
    }
}

But I am not even sure if |PanelUI.addonNotificationContaier| can be 
null when |updateAlerts()| is called. This may be an edge case.
Or this may be really a very bad bug.
And if it is null, we may have to do something special.
So I leave it to the people in the know to produce a patch.

BTW, this error is encountered AFTER the patch in 
 Bug 1634511 was applied.

Moral of the story. mochitest infrastructure/harness REALLY OUGHT TO FAIL a
test that produces JavaScript Error during its execution. PERIOD.
Running mochitest of FULL DEBUG version of thunderbird
produces the following error.
120 at the beginning of line is the frequencey of occurences.

    120 INFO Console message: [JavaScript Error: "TypeError: can't access property "firstChild", container is undefined" {file: "chrome://messenger/content/customizableui/panelUI.js" line: 1324}]


mozilla/comm/mail/components/customizableui/content/panelUI.js


  updateAlerts() {
    let tabmail = document.getElementById("tabmail");
    let sideloaded = ExtensionsUI.sideloaded;
    let updates = ExtensionsUI.updates;
    let container = PanelUI.addonNotificationContainer;

    while (container.firstChild) {    <=== here
      container.firstChild.remove();
    }


I think the whole while-statement  ought to be enclosed in a if
(conainer) check.

if (container) {
    while (container.firstChild) {
      container.firstChild.remove();
    }
}

But I am not even sure if |PanelUI.addonNotificationContaier| can be 
null when |updateAlerts()| is called. This may be an edge case.
Or this may be really a very bad bug.
And if it is null, we may have to do something special.
So I leave it to the people in the know to produce a patch.

BTW, this error is encountered AFTER the patch in 
 Bug 1634511 was applied.

Moral of the story. mochitest infrastructure/harness REALLY OUGHT TO FAIL a
test that produces JavaScript Error during its execution. PERIOD. (Or does it? I am new to mochitest. It is in place since last December.)

Back to Bug 1635019 Comment 0