Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CRX] Call callback instead of onCompleted #6520

Merged
merged 1 commit into from
Oct 12, 2015

Conversation

Rob--W
Copy link
Member

@Rob--W Rob--W commented Oct 11, 2015

Call callback() instead of onCompleted() to resolve a TypeError (reported via the CWS):

Error in event handler for (unknown): TypeError: Cannot read property 'onDisconnect' of null
    at onCompleted (chrome-extension://oemmndcbldboiebfnladdacbdfmadadm/content/web/viewer.js:1178:11)
    at onDisconnect (chrome-extension://oemmndcbldboiebfnladdacbdfmadadm/content/web/viewer.js:1175:7)
    at Function.target.(anonymous function) (extensions::SafeBuiltins:19:14)
    at Event.dispatchToListener (extensions::event_bindings:394:22)
    at Event.dispatch_ (extensions::event_bindings:378:27)
    at Event.dispatch (extensions::event_bindings:400:17)
    at dispatchOnDisconnect (extensions::messaging:293:27)

@@ -275,7 +275,7 @@ var ChromeCom = (function ChromeComClosure() {
function onDisconnect() {
// When the connection fails, ignore the error and call the callback.
port = null;
onCompleted();
callback();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be missing something obvious here, but won't this cause the eventListeners to remain attached? Or, does that simply not matter here?

Copy link
Member Author

@Rob--W Rob--W Oct 12, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Snuffleupagus
Copy link
Collaborator

Seems fine then, thanks!

Snuffleupagus added a commit that referenced this pull request Oct 12, 2015
[CRX] Call callback instead of onCompleted
@Snuffleupagus Snuffleupagus merged commit 6019b09 into mozilla:master Oct 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants