Closed Bug 1368823 Opened 2 years ago Closed 2 years ago

TB's preferences accessing non-existent elements when updater is disabled

Categories

(Thunderbird :: Preferences, defect)

defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 55.0

People

(Reporter: aceman, Assigned: aceman)

References

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

4.04 KB, patch
aceman
: review+
Details | Diff | Splinter Review
When the MOZ_UPDATER is disabled in .mozconfig, visiting TB's preferences -> Advanced panel produces an error in console about:
23:13:12.076 document.getElementById(...) is null 1 advanced.js:124
	init chrome://messenger/content/preferences/advanced.js:124:5
	anonymous chrome://global/content/bindings/preferences.xml%20line%20753%20%3E%20Function:3:1
	_fireEvent chrome://global/content/bindings/preferences.xml:754:24
	observe chrome://global/content/bindings/preferences.xml:729:17

The advanced.js code gets document.getElementById("version"), which doesn't exist in the DOM. That's true because in advanced.xul the updater elements are ifdeffed out when MOZ_UPDATER is unset.
Attached patch patch (obsolete) — Splinter Review
Attachment #8872777 - Flags: review?(richard.marti)
Comment on attachment 8872777 [details] [diff] [review]
patch

Not tested the patch but it looks reasonable.

Shouldn't the part after |if (AppConstants.MOZ_UPDATER) {| until |gAppUpdater = new appUpdater();| be indented?
Attachment #8872777 - Flags: review?(richard.marti) → review+
Theoretically it should, I just didn't want to touch it only for re-indenting :) I'm not sure what the lesser evil is :)
Jorg, what do you prefer?
Flags: needinfo?(jorgk)
Always indent correctly, no question.
Flags: needinfo?(jorgk)
Attached patch patch v1.1Splinter Review
Ok, thanks.
Attachment #8872777 - Attachment is obsolete: true
Attachment #8873585 - Flags: review+
Keywords: checkin-needed
https://hg.mozilla.org/comm-central/rev/3b89a5265c23eb2d1412eb210e976cae0c3eb8e2
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 55.0
You need to log in before you can comment on or make changes to this bug.