aboutsummaryrefslogtreecommitdiff
path: root/mail/thunderbird/files/patch-bug1664607
blob: 28053bd8ccb917dc09428858e0787d118b5d1c56 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# HG changeset patch
# User Rob Lemley <rob@thunderbird.net>
# Date 1600079976 -10800
# Node ID 6379c3b860f7a1acc01dc549b6ce3cedf250831b
# Parent  d1ffffd30cb1c6b4c636f89006c89cfa73282216
Bug 1664607 - Don't try to load what's new page when built with updater disabled. r=mkmelin DONTBUILD

When Thunderbird is built with --disable-updater, as it done by most Linux
distributions, accessing the nsIUpdateManager service will throw an error
resulting in a broken UI. Check AppConstants.MOZ_UPDATER when using
nsIUpdateManger to prevent errors.

Differential Revision: https://phabricator.services.mozilla.com/D90023

diff --git a/mail/base/content/specialTabs.js b/mail/base/content/specialTabs.js
--- comm/mail/base/content/specialTabs.js
+++ comm/mail/base/content/specialTabs.js
@@ -1048,18 +1048,20 @@ var specialTabs = {
       Services.prefs.setCharPref("mailnews.start_page_override.mstone", mstone);
     }
 
-    let update = Cc["@mozilla.org/updates/update-manager;1"].getService(
-      Ci.nsIUpdateManager
-    ).activeUpdate;
+    if (AppConstants.MOZ_UPDATER) {
+      let update = Cc["@mozilla.org/updates/update-manager;1"].getService(
+        Ci.nsIUpdateManager
+      ).activeUpdate;
 
-    if (update && Services.vc.compare(update.appVersion, old_mstone) > 0) {
-      let overridePage = Services.urlFormatter.formatURLPref(
-        "mailnews.start_page.override_url"
-      );
-      overridePage = this.getPostUpdateOverridePage(update, overridePage);
-      overridePage = overridePage.replace("%OLD_VERSION%", old_mstone);
-      if (overridePage) {
-        openLinkExternally(overridePage);
+      if (update && Services.vc.compare(update.appVersion, old_mstone) > 0) {
+        let overridePage = Services.urlFormatter.formatURLPref(
+          "mailnews.start_page.override_url"
+        );
+        overridePage = this.getPostUpdateOverridePage(update, overridePage);
+        overridePage = overridePage.replace("%OLD_VERSION%", old_mstone);
+        if (overridePage) {
+          openLinkExternally(overridePage);
+        }
       }
     }
   },