Bug 829927 - Don't read favicon URL if it's null. r=mfinkle
authorBrian Nicholson <bnicholson@mozilla.com>
Wed, 20 Feb 2013 17:16:50 -0800
changeset 122676 2b40ffaf95cbfa2a3924a72d98e4e7502b2500f3
parent 122675 18b38e18b751e0521309a5da960a473e8804e216
child 122677 87ab1cbdcea34320a9f21dc4e709620b8b587c20
push id24356
push usergszorc@mozilla.com
push dateSun, 24 Feb 2013 01:00:12 +0000
treeherdermozilla-central@195e706140d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs829927
milestone22.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 829927 - Don't read favicon URL if it's null. r=mfinkle
mobile/android/base/db/BrowserProvider.java.in
--- a/mobile/android/base/db/BrowserProvider.java.in
+++ b/mobile/android/base/db/BrowserProvider.java.in
@@ -1558,20 +1558,21 @@ public class BrowserProvider extends Con
                             Obsolete.Images.FAVICON,
                             Obsolete.Images.DATE_MODIFIED,
                             Obsolete.Images.DATE_CREATED
                         },
                         Obsolete.Images.FAVICON + " IS NOT NULL",
                         null, null, null, null);
 
                 while (c.moveToNext()) {
-                    String faviconUrl = c.getString(c.getColumnIndexOrThrow(Obsolete.Images.FAVICON_URL));
                     long faviconId = -1;
-
-                    if (faviconUrl != null) {
+                    int faviconUrlIndex = c.getColumnIndexOrThrow(Obsolete.Images.FAVICON_URL);
+                    String faviconUrl = null;
+                    if (!c.isNull(faviconUrlIndex)) {
+                        faviconUrl = c.getString(faviconUrlIndex);
                         Cursor c2 = null;
                         try {
                             c2 = db.query(TABLE_FAVICONS,
                                     new String[] { Favicons._ID },
                                     Favicons.URL + " = ?",
                                     new String[] { faviconUrl },
                                     null, null, null);
                             if (c2.moveToFirst()) {