From a2bc4495f8b8a82b0227f21bce14ed6985eb812b Mon Sep 17 00:00:00 2001 From: Wes Johnston Date: Tue, 16 Sep 2014 17:16:42 -0700 Subject: [PATCH] Bug 1063896 - Loop over all url list, not just ones with metadata. r=lucasr --- mobile/android/base/home/TopSitesPanel.java | 28 ++++++++++----------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/mobile/android/base/home/TopSitesPanel.java b/mobile/android/base/home/TopSitesPanel.java index 9aa1f6604ac..26ea3f154b5 100644 --- a/mobile/android/base/home/TopSitesPanel.java +++ b/mobile/android/base/home/TopSitesPanel.java @@ -675,6 +675,10 @@ public class TopSitesPanel extends HomeFragment { } public static ThumbnailInfo fromMetadata(final Map data) { + if (data == null) { + return null; + } + final String imageUrl = (String) data.get(TILE_IMAGE_URL_COLUMN); if (imageUrl == null) { return null; @@ -721,22 +725,16 @@ public class TopSitesPanel extends HomeFragment { final Map> metadata = URLMetadata.getForUrls(cr, mUrls, COLUMNS); // Keep a list of urls that don't have tiles images. We'll use thumbnails for them instead. - final List thumbnailUrls; - if (metadata != null) { - thumbnailUrls = new ArrayList(); - - for (String url : metadata.keySet()) { - ThumbnailInfo info = ThumbnailInfo.fromMetadata(metadata.get(url)); - if (info == null) { - // If we didn't find metadata, we'll look for a thumbnail for this url. - thumbnailUrls.add(url); - continue; - } - - thumbnails.put(url, info); + final List thumbnailUrls = new ArrayList(); + for (String url : mUrls) { + ThumbnailInfo info = ThumbnailInfo.fromMetadata(metadata.get(url)); + if (info == null) { + // If we didn't find metadata, we'll look for a thumbnail for this url. + thumbnailUrls.add(url); + continue; } - } else { - thumbnailUrls = new ArrayList(mUrls); + + thumbnails.put(url, info); } if (thumbnailUrls.size() == 0) {