mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 22:05:44 +00:00
Bug 1089940 - Check for null earlier in favicon data: URI handling. r=ckitching
This commit is contained in:
parent
5368b2ecee
commit
142fe53f37
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user