Skip to content

Commit

Permalink
Correctly handle empty suggested site list for widget.
Browse files Browse the repository at this point in the history
Bug: 763036
Change-Id: I6820caddfc64889bb35eb00788285a629f8fd623
Reviewed-on: https://chromium-review.googlesource.com/657637
Commit-Queue: Justin Cohen <[email protected]>
Reviewed-by: Justin Cohen <[email protected]>
Cr-Original-Commit-Position: refs/heads/master@{#500606}(cherry picked from commit 77f0bf1)
Reviewed-on: https://chromium-review.googlesource.com/677343
Reviewed-by: Olivier Robin <[email protected]>
Cr-Commit-Position: refs/branch-heads/3202@{crosswalk-project#374}
Cr-Branched-From: fa6a5d8-refs/heads/master@{#499098}
  • Loading branch information
Elodie Banel authored and Olivier Robin committed Sep 21, 2017
1 parent c435458 commit 9296972
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ios/chrome/browser/ui/ntp/ntp_tile_saver.mm
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ void SaveMostVisitedToDisk(const ntp_tiles::NTPTilesVector& mostVisitedData,
attributes:nil
error:nil];

// If there are 0 sites to display, the for loop below will not be entered.
// Write the updated empty list of sites to disk before returning.
if (mostVisitedData.size() == 0) {
WriteToDiskIfComplete(tiles, faviconsURL);
}

// For each site, get the favicon. If it is returned, write it to the favicon
// tmp folder. If a fallback value is returned, update the tile info. Calls
// WriteToDiskIfComplete after each callback execution.
Expand Down

0 comments on commit 9296972

Please sign in to comment.