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

[or-cvs] r14348: Fix thrown exception in content policy. (torbutton/trunk/src/components)



Author: mikeperry
Date: 2008-04-10 03:41:02 -0400 (Thu, 10 Apr 2008)
New Revision: 14348

Modified:
   torbutton/trunk/src/components/cssblocker.js
Log:

Fix thrown exception in content policy.



Modified: torbutton/trunk/src/components/cssblocker.js
===================================================================
--- torbutton/trunk/src/components/cssblocker.js	2008-04-10 07:16:49 UTC (rev 14347)
+++ torbutton/trunk/src/components/cssblocker.js	2008-04-10 07:41:02 UTC (rev 14348)
@@ -99,7 +99,7 @@
      "pippki":true, "branding":true};
 
 var hostFreeSchemes = { "resource":true, "data":true, "cid":true, 
-     "file":true, "view-source":true};
+     "file":true, "view-source":true, "about":true};
 
 function ContentPolicy() {
     this._prefs = Components.classes["@mozilla.org/preferences-service;1"]
@@ -223,7 +223,13 @@
                     var targetScheme = contentLocation.scheme;
                     var targetHost = "";
                     if ( !(contentLocation.scheme in hostFreeSchemes) ) {
-                        targetHost = contentLocation.host;
+                        try {
+                            targetHost = contentLocation.host;
+                        } catch(e) {
+                            this.logger.eclog(4, "No host from: " +
+                                    requestOrigin.spec + " for: " +
+                                    contentLocation.spec);
+                        }
                     }
 
                     if (("about:blank" == contentLocation.spec)) {