зеркало из https://github.com/mozilla/gecko-dev.git
Was failing on Fennec because private browsing doesn't exist there -- now more gracefully handles missing components.
This commit is contained in:
Родитель
f9eff8780e
Коммит
f014c6bb51
|
@ -650,7 +650,8 @@ WeaveSvc.prototype = {
|
|||
reason = kSyncNotLoggedIn;
|
||||
else if (Svc.IO.offline)
|
||||
reason = kSyncNetworkOffline;
|
||||
else if (Svc.Private.privateBrowsingEnabled)
|
||||
else if (Svc.Private && Svc.Private.privateBrowsingEnabled)
|
||||
// Svc.Private doesn't exist on Fennec -- don't assume it's there.
|
||||
reason = kSyncInPrivateBrowsing;
|
||||
else if (Svc.Prefs.get("schedule", 0) != 1)
|
||||
reason = kSyncNotScheduled;
|
||||
|
|
|
@ -146,8 +146,15 @@ let Utils = {
|
|||
lazySvc: function Weave_lazySvc(dest, prop, cid, iface) {
|
||||
let getter = function() {
|
||||
delete dest[prop];
|
||||
dest[prop] = Cc[cid].getService(iface);
|
||||
return dest[prop];
|
||||
if (!Cc[cid]) {
|
||||
let log = Log4Moz.repository.getLogger("Service.Util");
|
||||
log.warn("Component " + cid + " requested, but doesn't exist on "
|
||||
+ "this platform.");
|
||||
return null;
|
||||
} else{
|
||||
dest[prop] = Cc[cid].getService(iface);
|
||||
return dest[prop];
|
||||
}
|
||||
};
|
||||
dest.__defineGetter__(prop, getter);
|
||||
},
|
||||
|
|
Загрузка…
Ссылка в новой задаче