Bug 1180106 - Don't attempt to fetch an FxA user profile when no user is logged in. r=oeger
authorMark Hammond <mhammond@skippinet.com.au>
Fri, 03 Jul 2015 15:04:22 +1000
changeset 281556 703050be92f374cb56110f74d9308a932bb0f340
parent 281555 4cc8a471f7ea408a2d1fb74995b3c4314be41652
child 281557 b9a3ef8cff4bece2f8efd5de547412855c9e290f
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-beta@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersoeger
bugs1180106
milestone41.0a2
Bug 1180106 - Don't attempt to fetch an FxA user profile when no user is logged in. r=oeger
browser/base/content/browser-fxaccounts.js
--- a/browser/base/content/browser-fxaccounts.js
+++ b/browser/base/content/browser-fxaccounts.js
@@ -306,17 +306,17 @@ let gFxAccounts = {
       }
     }
 
     // Calling getSignedInUserProfile() without a user logged in causes log
     // noise that looks like an actual error...
     fxAccounts.getSignedInUser().then(userData => {
       // userData may be null here when the user is not signed-in, but that's expected
       updateWithUserData(userData);
-      return fxAccounts.getSignedInUserProfile();
+      return userData ? fxAccounts.getSignedInUserProfile() : null;
     }).then(profile => {
       if (!profile) {
         return;
       }
       updateWithProfile(profile);
     }).catch(error => {
       // This is most likely in tests, were we quickly log users in and out.
       // The most likely scenario is a user logged out, so reflect that.