Skip to content
This repository has been archived by the owner on Feb 29, 2020. It is now read-only.

Commit

Permalink
fix(mc): Ignore send failures to non-existent or unloading target pag…
Browse files Browse the repository at this point in the history
…es (#2746)
  • Loading branch information
Mardak committed Jun 21, 2017
1 parent 5e8e570 commit 8e48395
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions system-addon/lib/ActivityStreamMessageChannel.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ this.ActivityStreamMessageChannel = class ActivityStreamMessageChannel {
send(action) {
const targetId = action.meta && action.meta.toTarget;
const target = this.getTargetById(targetId);
if (!target) {
// The target is no longer around - maybe the user closed the page
return;
try {
target.sendAsyncMessage(this.outgoingMessageName, action);
} catch (e) {
// The target page is closed/closing by the user or test, so just ignore.
}
target.sendAsyncMessage(this.outgoingMessageName, action);
}

/**
Expand Down

0 comments on commit 8e48395

Please sign in to comment.