Closed Bug 1798908 Opened 3 years ago Closed 3 years ago

SitePermsAddonProvider.shutdown should only call Services.obs.removeObserver for the "perf-changed" topic if its lazyInit method was actually called

Categories

(Toolkit :: Add-ons Manager, defect, P2)

defect
Points:
1

Tracking

()

RESOLVED FIXED
108 Branch
Tracking Status
firefox108 --- fixed

People

(Reporter: rpl, Assigned: rpl)

References

Details

Attachments

(1 file)

I noticed that SitePermsAddonProvider.shutdown was throwing from the call to Services.obs.removeObserver in an unrelated xpcshell test I was working on.

Services.obs.removeObserver will be throwing when there isn't an observer actually registered, and that happens if lazyInit has never been actually called (e.g. because the provider's getAddonsByType and getAddonByID methods are never been called), and so we should check if this._initPromise is set and do not call Services.obs.removeObserver if it isn't.

Pushed by luca.greco@alcacoop.it: https://hg.mozilla.org/integration/autoland/rev/d48dd230d8d4 SitePermsAddonProvider.shutdown should not call Services.obs.removeObserver if this._initPromise is not set. r=nchevobbe
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 108 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: