diff options
-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)) { |