JavaScript Error: "TypeError: can't access property "firstChild", container is undefined" {file: "chrome://messenger/content/customizableui/panelUI.js" line: 1324}]
Categories
(Thunderbird :: Mail Window Front End, defect)
Tracking
(thunderbird78 fixed)
Tracking | Status | |
---|---|---|
thunderbird78 | --- | fixed |
People
(Reporter: ishikawa, Assigned: darktrojan)
Details
Attachments
(1 file)
5.68 KB,
patch
|
mkmelin
:
review+
wsmwk
:
approval-comm-beta+
|
Details | Diff | Splinter Review |
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.)
Assignee | ||
Comment 1•4 years ago
|
||
It's undefined because we're init'ing gExtensionsNotifications
too early, before PanelUI
. I've changed it so that it doesn't happen on load, instead, after PanelUI.init
. Also tidied up the linter imports.
Comment 2•4 years ago
|
||
Comment on attachment 9158071 [details] [diff] [review] 1635019-container-is-undefined-1.diff Review of attachment 9158071 [details] [diff] [review]: ----------------------------------------------------------------- Great, r=mkmelin
Assignee | ||
Updated•4 years ago
|
Updated•4 years ago
|
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/cdb11b6187f0
Fix "container is undefined" error in panelUI.js. r=mkmelin
Assignee | ||
Comment 4•4 years ago
|
||
Comment on attachment 9158071 [details] [diff] [review] 1635019-container-is-undefined-1.diff We should take this. One less source of useless error messages.
Comment 5•4 years ago
|
||
Comment on attachment 9158071 [details] [diff] [review] 1635019-container-is-undefined-1.diff Approved for beta
Comment 6•4 years ago
|
||
bugherder uplift |
Thunderbird 78.0b4:
https://hg.mozilla.org/releases/comm-beta/rev/5eb5649458a8
Updated•4 years ago
|
Description
•