Bug 1310622 - Display the item as-is but do not load an icon if we do not have a page URL r=sebastian draft
authorNevin Chen <cnevinchen@gmail.com>
Tue, 13 Dec 2016 13:18:55 +0800
changeset 450988 58e986dfbc614ebd2b59c85a1a35cdbab3877bfa
parent 446144 27449c736a04eec8c9033d70697747fce3a3c13d
child 539884 03b7c25c14244a6d267678d63a24547595bbd2d0
push id39007
push userbmo:cnevinchen@gmail.com
push dateMon, 19 Dec 2016 09:11:49 +0000
reviewerssebastian
bugs1310622
milestone53.0a1
Bug 1310622 - Display the item as-is but do not load an icon if we do not have a page URL r=sebastian MozReview-Commit-ID: Ij9VS5NvMAs
mobile/android/base/java/org/mozilla/gecko/home/TwoLinePageRow.java
--- a/mobile/android/base/java/org/mozilla/gecko/home/TwoLinePageRow.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/TwoLinePageRow.java
@@ -269,17 +269,19 @@ public class TwoLinePageRow extends Line
         if (mOngoingIconLoad != null) {
             mOngoingIconLoad.cancel(true);
         }
 
         // Displayed RecentTabsPanel URLs may refer to pages opened in reader mode, so we
         // remove the about:reader prefix to ensure the Favicon loads properly.
         final String pageURL = ReaderModeUtils.stripAboutReaderUrl(url);
 
-        if (bookmarkId < BrowserContract.Bookmarks.FAKE_PARTNER_BOOKMARKS_START) {
+        if (TextUtils.isEmpty(pageURL)) {
+            // If url is empty, display the item as-is but do not load an icon if we do not have a page URL (bug 1310622)
+        } else if (bookmarkId < BrowserContract.Bookmarks.FAKE_PARTNER_BOOKMARKS_START) {
             mOngoingIconLoad = Icons.with(getContext())
                     .pageUrl(pageURL)
                     .skipNetwork()
                     .privileged(true)
                     .icon(IconDescriptor.createGenericIcon(
                             PartnerBookmarksProviderProxy.getUriForIcon(getContext(), bookmarkId).toString()))
                     .build()
                     .execute(mFavicon.createIconCallback());