[Pkg-mozext-commits] [wot] 142/226: Fixed "Exception about accessing dead object"

David Prévot taffit at moszumanska.debian.org
Fri May 1 00:35:44 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository wot.

commit 74b980a9d4d426743991a7437250505fc3a1dd3f
Author: Sergey Andryukhin <sorgoz at yandex.com>
Date:   Mon Sep 2 16:48:24 2013 +0300

    Fixed "Exception about accessing dead object"
---
 content/my.js      | 14 +++++++-------
 content/search.js  |  5 +++++
 content/surveys.js |  4 ++++
 content/warning.js |  4 ++++
 4 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/content/my.js b/content/my.js
index 67447e1..272004c 100644
--- a/content/my.js
+++ b/content/my.js
@@ -23,18 +23,18 @@ var wot_my_session =
 	domcontentloaded: function(e)
 	{
 		try {
+            try {   // Workaround to resolve "TypeError: can't access dead object" at start of the browser
+                if (!e.originalTarget) return;
+            } catch (e) { return; } // do nothing
+
 			var content = e.originalTarget;
 
-			if (!content || !content.location || !content.location.href) {
-				return;
-			}
+			if (!content || !content.location || !content.location.href) return;
 
 			var host = wot_url.gethostname(content.location.href);
 
-			if (!host || !WOT_MY_TRIGGER.test(host)) {
-				return;
-			}
-			
+			if (!host || !WOT_MY_TRIGGER.test(host)) return;
+
 			var clear = content.getElementById("wotsaverating");
 
 			if (clear) {
diff --git a/content/search.js b/content/search.js
index 4717903..150ad58 100644
--- a/content/search.js
+++ b/content/search.js
@@ -436,6 +436,11 @@ var wot_search =
 
 	domcontentloaded: function(event)
 	{
+
+        try {   // Workaround to resolve "TypeError: can't access dead object" at start of the browser
+            if (!e.originalTarget) return;
+        } catch (e) { return; } // do nothing
+
 		try {
 			wot_search.watch(event.originalTarget);
 		} catch (e) {
diff --git a/content/surveys.js b/content/surveys.js
index cae95ff..1394fec 100644
--- a/content/surveys.js
+++ b/content/surveys.js
@@ -78,6 +78,10 @@ var wot_surveys = {
 				return;
 			}
 
+            try {   // Workaround to resolve "TypeError: can't access dead object" at start of the browser
+                if (!event.originalTarget) { return; }
+            } catch (e) { return; }
+
 			var content = event.originalTarget,
 				location = (content && content.location) ? content.location : {};
 
diff --git a/content/warning.js b/content/warning.js
index 131a1a5..4560b0e 100644
--- a/content/warning.js
+++ b/content/warning.js
@@ -326,6 +326,10 @@ var wot_warning =
 				return;
 			}
 
+            try {   // Workaround to resolve "TypeError: can't access dead object" at start of the browser
+                if (!event.originalTarget) { return; }
+            } catch (e) { return; }
+
 			var content = event.originalTarget;
 
             // Don't show warnings in frames

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/wot.git



More information about the Pkg-mozext-commits mailing list