Index: chrome/browser/extensions/api/identity/account_tracker.cc |
diff --git a/chrome/browser/extensions/api/identity/account_tracker.cc b/chrome/browser/extensions/api/identity/account_tracker.cc |
index ea09479bd4193855630b4b7a848488f7af900334..f046ff5f4e004593c1eae9a69ef196f08273edca 100644 |
--- a/chrome/browser/extensions/api/identity/account_tracker.cc |
+++ b/chrome/browser/extensions/api/identity/account_tracker.cc |
@@ -51,6 +51,12 @@ void AccountTracker::RemoveObserver(Observer* observer) { |
} |
void AccountTracker::OnRefreshTokenAvailable(const std::string& account_id) { |
+ // Ignore refresh tokens if there is no primary account ID at all. |
+ ProfileOAuth2TokenService* token_service = |
+ ProfileOAuth2TokenServiceFactory::GetForProfile(profile_); |
+ if (token_service->GetPrimaryAccountId().empty()) |
+ return; |
+ |
DVLOG(1) << "AVAILABLE " << account_id; |
ClearAuthError(account_id); |
UpdateSignInState(account_id, true); |