Skip missing nsIDragSession.sourceDocument

See https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIDragSession#Attributes
This commit is contained in:
Infocatcher 2012-08-29 18:29:04 +04:00
parent 5e39c1b25b
commit 13eee1e594

View File

@ -1038,6 +1038,8 @@ catch(e) {
if (!session) //TODO: use some fake nodePrincipal? if (!session) //TODO: use some fake nodePrincipal?
throw 'Drop of ' + aURI + ' denied: no drag session.'; throw 'Drop of ' + aURI + ' denied: no drag session.';
let sourceDoc = session.sourceDocument; let sourceDoc = session.sourceDocument;
if (!sourceDoc) // The drag originated outside the application
return;
let sourceURI = sourceDoc.documentURI; let sourceURI = sourceDoc.documentURI;
let normalizedURI = this.treeStyleTab.makeURIFromSpec(aURI); let normalizedURI = this.treeStyleTab.makeURIFromSpec(aURI);
if (normalizedURI && sourceURI.substr(0, 9) != 'chrome://') { if (normalizedURI && sourceURI.substr(0, 9) != 'chrome://') {