From 7f5979a5598e67a9c32f47573c1e2b0ebafea417 Mon Sep 17 00:00:00 2001 From: Gian-Carlo Pascutto Date: Fri, 30 Dec 2011 02:41:16 +0100 Subject: [PATCH] Bug 714148 - Check whether favicon images are decoded successfully. r=mfinkle --- mobile/android/base/ProfileMigrator.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mobile/android/base/ProfileMigrator.java b/mobile/android/base/ProfileMigrator.java index 2c24a5e29d3e..7c455c54a0a3 100644 --- a/mobile/android/base/ProfileMigrator.java +++ b/mobile/android/base/ProfileMigrator.java @@ -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()); + } } }