Bug 1233016 - about:profiles should handle errors when the defaultProfile is not set, r=ehsan
authorAndrea Marchesini <amarchesini@mozilla.com>
Fri, 18 Dec 2015 16:58:31 +0000
changeset 277029 2400272b81cfa4627eae0e78785b995128a3031a
parent 277028 4e45686cef0f98038709e50eee73a3dd507b85a4
child 277030 d3c254e1d98a3ec6003a0605a2ed33ea33282874
push id29814
push usercbook@mozilla.com
push dateMon, 21 Dec 2015 10:52:58 +0000
treeherdermozilla-central@e6ba2d4a2e49 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1233016
milestone46.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1233016 - about:profiles should handle errors when the defaultProfile is not set, r=ehsan
toolkit/content/aboutProfiles.js
--- a/toolkit/content/aboutProfiles.js
+++ b/toolkit/content/aboutProfiles.js
@@ -57,23 +57,28 @@ function refreshUI() {
     document.getElementById('action-box').style.display = 'none';
   }
 
   let parent = document.getElementById('profiles');
   while (parent.firstChild) {
     parent.removeChild(parent.firstChild);
   }
 
-  let currentProfile = findCurrentProfile() || ProfileService.defaultProfile;
+  let defaultProfile;
+  try {
+    defaultProfile = ProfileService.defaultProfile;
+  } catch(e) {}
+
+  let currentProfile = findCurrentProfile() || defaultProfile;
 
   let iter = ProfileService.profiles;
   while (iter.hasMoreElements()) {
     let profile = iter.getNext().QueryInterface(Ci.nsIToolkitProfile);
     display({ profile: profile,
-              isDefault: profile == ProfileService.defaultProfile,
+              isDefault: profile == defaultProfile,
               isCurrentProfile: profile == currentProfile });
   }
 
   let createButton = document.getElementById('create-button');
   createButton.onclick = createProfileWizard;
 
   let restartSafeModeButton = document.getElementById('restart-in-safe-mode-button');
   restartSafeModeButton.onclick = function() { restart(true); }