[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r17156: {torbutton} Catch a potential exception in hook flag checking that might (torbutton/trunk/src/chrome/content)



Author: mikeperry
Date: 2008-10-26 18:14:22 -0400 (Sun, 26 Oct 2008)
New Revision: 17156

Modified:
   torbutton/trunk/src/chrome/content/torbutton.js
Log:

Catch a potential exception in hook flag checking that might
be triggered by noscript.



Modified: torbutton/trunk/src/chrome/content/torbutton.js
===================================================================
--- torbutton/trunk/src/chrome/content/torbutton.js	2008-10-26 11:56:29 UTC (rev 17155)
+++ torbutton/trunk/src/chrome/content/torbutton.js	2008-10-26 22:14:22 UTC (rev 17156)
@@ -2360,7 +2360,12 @@
 }
 
 function torbutton_check_flag(obj, flag) {
-    return (typeof(obj[flag]) != 'undefined');
+    try {
+        return (typeof(obj[flag]) != 'undefined');
+    } catch(e) {
+        torbutton_log(5, "Exception on flag "+flag+" check: "+e); 
+        return true;
+    }
 }
 
 function torbutton_is_same_origin(source, target) { // unused.