mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 07:08:08 +02:00
Merge pull request #2668 from vyv03354/bug834075
Handle the error in case the sender is already unloaded
This commit is contained in:
commit
f32233eaf9
1 changed files with 7 additions and 1 deletions
|
@ -473,7 +473,13 @@ RequestListener.prototype.receive = function(event) {
|
|||
response = null;
|
||||
} else {
|
||||
response = function sendResponse(response) {
|
||||
message.setUserData('response', response, null);
|
||||
try {
|
||||
message.setUserData('response', response, null);
|
||||
} catch (e) {
|
||||
// message is no longer accessible because the sender is already
|
||||
// gone. the unloaded sender cannot receive the response anyway.
|
||||
return false;
|
||||
}
|
||||
|
||||
var listener = doc.createEvent('HTMLEvents');
|
||||
listener.initEvent('pdf.js.response', true, false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue