Bug 1233016 - about:profiles should handle errors when the defaultProfile is not set, r=ehsan

This commit is contained in:
Andrea Marchesini 2015-12-18 16:58:31 +00:00
parent c3cea57c51
commit d2c3f5e6f1

View File

@ -62,13 +62,18 @@ function refreshUI() {
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 });
}