diff options
author | John Reck <jreck@google.com> | 2011-01-07 10:09:56 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-01-07 10:09:56 -0800 |
commit | ff18134fa8c3cc6a20e75b58b19274d7f0019eb9 (patch) | |
tree | 36b2140f00cb8b14722468bd07413c83c9319984 /src/com/android | |
parent | 6cb6e557e59030449cd399d6687062bec19bb324 (diff) | |
parent | 6c702eed5791d0d46fbe3dfd3054549997f218dc (diff) | |
download | packages_apps_Browser-ff18134fa8c3cc6a20e75b58b19274d7f0019eb9.zip packages_apps_Browser-ff18134fa8c3cc6a20e75b58b19274d7f0019eb9.tar.gz packages_apps_Browser-ff18134fa8c3cc6a20e75b58b19274d7f0019eb9.tar.bz2 |
Merge "Fix NPE in queryIsBookmark" into honeycomb
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/browser/DataController.java | 7 | ||||
-rw-r--r-- | src/com/android/browser/Tab.java | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/com/android/browser/DataController.java b/src/com/android/browser/DataController.java index aa233fd..a56fce8 100644 --- a/src/com/android/browser/DataController.java +++ b/src/com/android/browser/DataController.java @@ -100,7 +100,12 @@ public class DataController { } public void queryBookmarkStatus(String url, OnQueryUrlIsBookmark replyTo) { - mDataHandler.sendMessage(QUERY_URL_IS_BOOKMARK, url, replyTo); + if (url == null || url.trim().length() == 0) { + // null or empty url is never a bookmark + replyTo.onQueryUrlIsBookmark(url, false); + return; + } + mDataHandler.sendMessage(QUERY_URL_IS_BOOKMARK, url.trim(), replyTo); } // The standard Handler and Message classes don't allow the queue manipulation diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java index c4edda6..320d3b3 100644 --- a/src/com/android/browser/Tab.java +++ b/src/com/android/browser/Tab.java @@ -546,6 +546,9 @@ class Tab { mInPageLoad = false; // Sync state (in case of stop/timeout) mCurrentState.mUrl = view.getUrl(); + if (mCurrentState.mUrl == null) { + mCurrentState.mUrl = url != null ? url : ""; + } mCurrentState.mTitle = view.getTitle(); mCurrentState.mFavicon = view.getFavicon(); if (!URLUtil.isHttpsUrl(mCurrentState.mUrl)) { |