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]
--- 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)