From b02148e1a77286a2300130b74bb5f0edc461a1bb Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Mon, 8 Sep 2014 13:36:22 -0700 Subject: [PATCH] Bug 1062631 - Handle null ownerDoc in browser.js and content.js for the benefit of browser_newtab_drag_drop_ext.js. r=ttaubert --- browser/base/content/browser.js | 3 +++ browser/base/content/content.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index d07579831e0..ff97b34b4dc 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -2336,6 +2336,9 @@ let BrowserOnClick = { let originalTarget = event.originalTarget; let ownerDoc = originalTarget.ownerDocument; + if (!ownerDoc) { + return; + } if (gMultiProcessBrowser && ownerDoc.documentURI.toLowerCase() == "about:newtab") { diff --git a/browser/base/content/content.js b/browser/base/content/content.js index 750ea6bc9dc..7550f13eb74 100644 --- a/browser/base/content/content.js +++ b/browser/base/content/content.js @@ -370,6 +370,9 @@ let ClickEventHandler = { let originalTarget = event.originalTarget; let ownerDoc = originalTarget.ownerDocument; + if (!ownerDoc) { + return; + } // Handle click events from about pages if (ownerDoc.documentURI.startsWith("about:certerror")) {