Closed Bug 1531295 Opened 6 years ago Closed 6 years ago

JavaScript error: resource:///modules/UrlbarView.jsm, line 586: TypeError: item is undefined

Categories

(Firefox :: Address Bar, defect, P2)

defect

Tracking

()

RESOLVED FIXED
Firefox 67
Tracking Status
firefox-esr60 --- unaffected
firefox65 --- unaffected
firefox66 --- unaffected
firefox67 --- fixed

People

(Reporter: standard8, Assigned: adw)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fxsearch])

Attachments

(1 file)

I'm seeing this error happen in porting browser_switchTab_decodeuri.js to QuantumBar. I can't reproduce it manually yet.

JavaScript error: resource:///modules/UrlbarView.jsm, line 586: TypeError: item is undefined

https://searchfox.org/mozilla-central/rev/2a6f3dde00801374d3b2a704232de54a132af389/browser/components/urlbar/UrlbarView.jsm#586

From the looks of it, we're triggering UrlbarView._on_SelectedOneOffButtonChanged when the popup is hidden, and we're setting the selected engine to null.

My guess is that the rows may have gone away, but we've still got the queryContext.

Blocks: 1527947
Assignee: nobody → adw
Status: NEW → ASSIGNED

The SelectedOneOffButtonChanged can fire when the popup is closed, so we should ignore it then. browser_switchTab_decodeuri.js hits this, as Mark says in the bug. The stack is:

_on_SelectedOneOffButtonChanged@resource:///modules/UrlbarView.jsm:569:131
handleEvent@resource:///modules/UrlbarView.jsm:298:23
dispatchEvent@chrome://browser/content/search/search-one-offs.js:147:20
set selectedButton@chrome://browser/content/search/search-one-offs.js:306:10
_on_popuphidden/<@chrome://browser/content/search/search-one-offs.js:1281:7

Alternatively we could modify the selectedButton setter in the one offs not to fire the event when the popup is closed. However, theoretically someone could be interested in listening for the selected button change even then, so I think it's better to modify the listener here.

Pushed by dgottwald@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5bda26248e68 Ignore the SelectedOneOffButtonChanged event when the popup is closed. r=dao
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 67
Keywords: regression
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: