Index: chrome/browser/ui/webui/ntp/foreign_session_handler.cc |
diff --git a/chrome/browser/ui/webui/ntp/foreign_session_handler.cc b/chrome/browser/ui/webui/ntp/foreign_session_handler.cc |
index 4a6bbaed1601a893c36c1a9f65c796fe3fc52ed2..4c5154d5bac9b9a0934ebd6666412072ca20e9d6 100644 |
--- a/chrome/browser/ui/webui/ntp/foreign_session_handler.cc |
+++ b/chrome/browser/ui/webui/ntp/foreign_session_handler.cc |
@@ -94,17 +94,11 @@ void ForeignSessionHandler::HandleGetForeignSessions(const ListValue* args) { |
SessionModelAssociator* associator = GetModelAssociator(); |
std::vector<const SyncedSession*> sessions; |
- if (associator == NULL) { |
- // Called before associator created, exit. |
+ // Exit if the associator is not created or there are no foreign sessions. |
+ if (!associator ||!associator->GetAllForeignSessions(&sessions)) |
return; |
- } |
// Note: we don't own the SyncedSessions themselves. |
- if (!associator->GetAllForeignSessions(&sessions)) { |
- LOG(ERROR) << "ForeignSessionHandler failed to get session data from" |
- "SessionModelAssociator."; |
- return; |
- } |
int added_count = 0; |
ListValue session_list; |
for (std::vector<const SyncedSession*>::const_iterator i = |