Bug 714148 - Check whether favicon images are decoded successfully. r=mfinkle

This commit is contained in:
Gian-Carlo Pascutto 2011-12-30 02:41:16 +01:00
parent 9a46933b03
commit 7f5979a559

View File

@ -263,11 +263,13 @@ public class ProfileMigrator {
protected void addFavicon(String url, String mime, byte[] data) {
ByteArrayInputStream byteStream = new ByteArrayInputStream(data);
BitmapDrawable image = (BitmapDrawable) Drawable.createFromStream(byteStream, "src");
try {
BrowserDB.updateFaviconForUrl(mCr, url, image);
} catch (SQLiteException e) {
Log.i(LOGTAG, "Migrating favicon failed: " + mime + " URL: " + url
+ " error:" + e.getMessage());
if (image != null) {
try {
BrowserDB.updateFaviconForUrl(mCr, url, image);
} catch (SQLiteException e) {
Log.i(LOGTAG, "Migrating favicon failed: " + mime + " URL: " + url
+ " error:" + e.getMessage());
}
}
}