Bug 409192 - "Applications prefpane is broken if shell service isn't available at runtime (Applications preferences dialogue is empty, no way to add applications)" [p=mh+mozilla@glandium.org (Mike Hommey) r=gavin]
authorMike Hommey <mh+mozilla@glandium.org>
Sat, 12 Jul 2008 03:40:15 -0500
changeset 15836 1c8fc62b5efffaec91592bd061e5da0de6a36ab9
parent 15835 101087d57ba5c5c26b40cfde004e82332a8222fe
child 15837 9834d1ab22d934964b6831c9ed5a617b5a54343e
push id544
push userreed@reedloden.com
push dateSat, 12 Jul 2008 08:46:05 +0000
treeherdermozilla-central@3268e0025bba [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin
bugs409192
milestone1.9.1a1pre
Bug 409192 - "Applications prefpane is broken if shell service isn't available at runtime (Applications preferences dialogue is empty, no way to add applications)" [p=mh+mozilla@glandium.org (Mike Hommey) r=gavin]
browser/components/preferences/applications.js
--- a/browser/components/preferences/applications.js
+++ b/browser/components/preferences/applications.js
@@ -533,18 +533,17 @@ FeedHandlerInfo.prototype = {
   // Convenience Utils
 
   _converterSvc:
     Cc["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"].
     getService(Ci.nsIWebContentConverterService),
 
   _shellSvc:
 #ifdef HAVE_SHELL_SERVICE
-    Cc["@mozilla.org/browser/shell-service;1"].
-    getService(Ci.nsIShellService),
+    getShellService(),
 #else
     null,
 #endif
 
 
   //**************************************************************************//
   // nsIHandlerInfo
 
@@ -665,17 +664,17 @@ FeedHandlerInfo.prototype = {
       return this.__defaultApplicationHandler;
 
     var defaultFeedReader = null;
 #ifdef HAVE_SHELL_SERVICE
     try {
       defaultFeedReader = this._shellSvc.defaultFeedReader;
     }
     catch(ex) {
-      // no default reader
+      // no default reader or _shellSvc is null
     }
 #endif
 
     if (defaultFeedReader) {
       let handlerApp = Cc["@mozilla.org/uriloader/local-handler-app;1"].
                        createInstance(Ci.nsIHandlerApp);
       handlerApp.name = getDisplayNameForFile(defaultFeedReader);
       handlerApp.QueryInterface(Ci.nsILocalHandlerApp);
@@ -692,17 +691,17 @@ FeedHandlerInfo.prototype = {
 
   get hasDefaultHandler() {
 #ifdef HAVE_SHELL_SERVICE
     try {
       if (this._shellSvc.defaultFeedReader)
         return true;
     }
     catch(ex) {
-      // no default reader
+      // no default reader or _shellSvc is null
     }
 #endif
 
     return false;
   },
 
   get defaultDescription() {
     if (this.hasDefaultHandler)