Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Call onUpdateFinished when appropriate.

Also, don't die if the expected AddonListener method isn't defined.

Fixes #1621
  • Loading branch information...
commit 5f332fc07ed46431b492bfeb63c46a0ab56f6525 1 parent 9e05d39
@arantius arantius authored
Showing with 11 additions and 5 deletions.
  1. +11 −5 modules/script.js
View
16 modules/script.js
@@ -768,11 +768,17 @@ Script.prototype.handleRemoteUpdate = function(aAvailable, aListener) {
if (aListener) {
// When in the add-ons manager, listeners are passed around to keep
// the UI up to date.
- if (aAvailable) {
- AddonManagerPrivate.callAddonListeners("onNewInstall", scriptInstall);
- aListener.onUpdateAvailable(addon, scriptInstall);
- } else {
- aListener.onNoUpdateAvailable(addon);
+ try {
+ if (aAvailable) {
+ AddonManagerPrivate.callAddonListeners("onNewInstall", scriptInstall);
+ aListener.onUpdateAvailable(addon, scriptInstall);
+ } else {
+ aListener.onNoUpdateAvailable(addon);
+ }
+ aListener(onUpdateFinished(addon, 0));
+ } catch (e) {
+ // See #1621. Don't die if (e.g.) an addon listener doesn't provide
+ // the entire interface and thus a method is undefined.
}
} else {
// Otherwise, just install.
Please sign in to comment.
Something went wrong with that request. Please try again.