diff options
author | John Reck <jreck@google.com> | 2011-01-07 09:41:53 -0800 |
---|---|---|
committer | John Reck <jreck@google.com> | 2011-01-07 09:41:53 -0800 |
commit | 6c702eed5791d0d46fbe3dfd3054549997f218dc (patch) | |
tree | ef325c0f170969c491b4f3390829c0282d2acf58 /src/com/android/browser/DataController.java | |
parent | 2ab6d2509cc1d9d55a97935501689fe08f8baf0c (diff) | |
download | packages_apps_Browser-6c702eed5791d0d46fbe3dfd3054549997f218dc.zip packages_apps_Browser-6c702eed5791d0d46fbe3dfd3054549997f218dc.tar.gz packages_apps_Browser-6c702eed5791d0d46fbe3dfd3054549997f218dc.tar.bz2 |
Fix NPE in queryIsBookmark
Bug: 3326838
Fixed a case where a Tab can have a null URL and added null checks
to the DataController.
Change-Id: I9b27479c522928cde5d427919f2f921ca94aec5d
Diffstat (limited to 'src/com/android/browser/DataController.java')
-rw-r--r-- | src/com/android/browser/DataController.java | 7 |
1 files changed, 6 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 |