Bug 738976 - java.lang.NullPointerException at org.mozilla.gecko.db.LocalBrowserDB.updateFaviconForUrl r=blassey
authorMark Finkle <mfinkle@mozilla.com>
Tue, 27 Mar 2012 08:47:14 -0400
changeset 90672 eda41c845ed599c3b2cdee48223061d7deafd1c0
parent 90671 585261ed3fc3f011d8dc8ceadb42062f7112f64b
child 90673 07b68ea1083f5931abd23cfc898831c9e703c43f
push id1069
push usermfinkle@mozilla.com
push dateWed, 04 Apr 2012 14:22:33 +0000
treeherdermozilla-aurora@883536e3b5da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersblassey
bugs738976
milestone13.0a2
Bug 738976 - java.lang.NullPointerException at org.mozilla.gecko.db.LocalBrowserDB.updateFaviconForUrl r=blassey
mobile/android/base/db/LocalBrowserDB.java
--- a/mobile/android/base/db/LocalBrowserDB.java
+++ b/mobile/android/base/db/LocalBrowserDB.java
@@ -588,16 +588,18 @@ public class LocalBrowserDB implements B
 
         Bitmap bitmap = BitmapFactory.decodeByteArray(b, 0, b.length);
         return new BitmapDrawable(bitmap);
     }
 
     public void updateFaviconForUrl(ContentResolver cr, String uri,
             BitmapDrawable favicon) {
         Bitmap bitmap = favicon.getBitmap();
+        if (bitmap == null)
+            return;
 
         ByteArrayOutputStream stream = new ByteArrayOutputStream();
         bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream);
 
         ContentValues values = new ContentValues();
         values.put(Images.FAVICON, stream.toByteArray());
         values.put(Images.URL, uri);