Bug 571008 - ViewerRegistry should guard against runtime errors in entry filters (real changes), r=sdwilsh, sr=neil SEAMONKEY_2_1a2_BUILD1 SEAMONKEY_2_1a2_BUILD2 SEAMONKEY_2_1a2_RELEASE
authorColby Russell <sevenspade@gmail.com>
Mon, 21 Jun 2010 21:54:45 -0500
changeset 912 03cf7e93828fcc03f50a090615eaa01e6286705d
parent 911 535e5fbda65c6590442e072c7087924e0396467c
child 913 58825c52bb153b4d35a6165131b57cbefb980c1f
child 917 686ee0326ae8ef869a654fd0174d55b1b4332274
push id191
push usersevenspade@gmail.com
push dateTue, 22 Jun 2010 03:03:58 +0000
reviewerssdwilsh, neil
bugs571008
Bug 571008 - ViewerRegistry should guard against runtime errors in entry filters (real changes), r=sdwilsh, sr=neil
resources/content/ViewerRegistry.js
--- a/resources/content/ViewerRegistry.js
+++ b/resources/content/ViewerRegistry.js
@@ -182,17 +182,23 @@ ViewerRegistry.prototype =
    *        The view object of linked panel.
    * @param aIndex
    *        The numerical index of the entry.
    * @return true if object can be viewed.
    */
   objectMatchesEntry:
     function VR_ObjectMatchesEntry(aObject, aLinkedViewer, aIndex)
   {
-    return this.mFilters[aIndex](aObject, aLinkedViewer);
+    try {
+      return this.mFilters[aIndex](aObject, aLinkedViewer);
+    }
+    catch (ex) {
+      Components.utils.reportError(ex);
+    }
+    return false;
   },
 
   /**
    * Notifies the registry that a viewer has been instantiated, and that it
    * corresponds to a particular entry in the viewer registry.
    *
    * @param aViewer
    *        The inIViewer object to cache.