Bug 1089940 - Check for null earlier in favicon data: URI handling. r=ckitching

This commit is contained in:
Richard Newman 2014-10-28 11:55:47 -07:00
parent 5368b2ecee
commit 142fe53f37

View File

@ -338,9 +338,12 @@ public class LoadFaviconTask {
// Attempt to decode the favicon URL as a data URL. We don't bother storing such URIs in
// the database: the cost of decoding them here probably doesn't exceed the cost of mucking
// about with the DB.
LoadFaviconResult uriBitmaps = FaviconDecoder.decodeDataURI(faviconURL);
if (uriBitmaps != null) {
return pushToCacheAndGetResult(uriBitmaps);
final boolean isEmpty = TextUtils.isEmpty(faviconURL);
if (!isEmpty) {
LoadFaviconResult uriBitmaps = FaviconDecoder.decodeDataURI(faviconURL);
if (uriBitmaps != null) {
return pushToCacheAndGetResult(uriBitmaps);
}
}
String storedFaviconUrl;
@ -348,7 +351,7 @@ public class LoadFaviconTask {
// Handle the case of malformed favicon URL.
// If favicon is empty, fall back to the stored one.
if (TextUtils.isEmpty(faviconURL)) {
if (isEmpty) {
// Try to get the favicon URL from the memory cache.
storedFaviconUrl = Favicons.getFaviconURLForPageURLFromCache(pageUrl);