зеркало из https://github.com/mozilla/gecko-dev.git
Bug 926497 - Prevent the favicon cache from throwing NPEs at odd moments. r=rnewman
This commit is contained in:
Родитель
7ad015820c
Коммит
201eee38ed
|
@ -351,6 +351,7 @@ public class Favicons {
|
|||
"/favicon.ico", null,
|
||||
null).toString();
|
||||
} catch (URISyntaxException e) {
|
||||
Log.e(LOGTAG, "URISyntaxException getting default favicon URL", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -234,6 +234,10 @@ public class LoadFaviconTask extends UiAsyncTask<Void, Void, Bitmap> {
|
|||
} else {
|
||||
// If we don't have a stored one, fall back to the default.
|
||||
mFaviconUrl = Favicons.guessDefaultFaviconURL(mPageUrl);
|
||||
|
||||
if (TextUtils.isEmpty(mFaviconUrl)) {
|
||||
return null;
|
||||
}
|
||||
isUsingDefaultURL = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -205,6 +205,10 @@ public class FaviconCache {
|
|||
* @return true if this favicon is blacklisted, false otherwise.
|
||||
*/
|
||||
public boolean isFailedFavicon(String faviconURL) {
|
||||
if (faviconURL == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
startRead();
|
||||
|
||||
boolean isExpired = false;
|
||||
|
@ -241,7 +245,7 @@ public class FaviconCache {
|
|||
// Flag to prevent finally from doubly-unlocking.
|
||||
isAborting = true;
|
||||
Log.e(LOGTAG, "FaviconCache exception!", unhandled);
|
||||
return false;
|
||||
return true;
|
||||
} finally {
|
||||
if (!isAborting) {
|
||||
if (isExpired) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче