diff options
author | Vivek Sekhar <vsekhar@codeaurora.org> | 2016-01-08 14:47:21 -0800 |
---|---|---|
committer | jrizzoli <joey@cyanogenmoditalia.it> | 2016-01-11 22:03:29 +0100 |
commit | 13198ac770e9d91d0035b513c8a5c0c6d9d2221c (patch) | |
tree | a856ae6f06b2a382d4131b54da8b0339e1963f3e /src/com/android | |
parent | d5f34f89df796fb2f4174a968a1c463f1f24478a (diff) | |
download | android_packages_apps_Gello-13198ac770e9d91d0035b513c8a5c0c6d9d2221c.tar.gz android_packages_apps_Gello-13198ac770e9d91d0035b513c8a5c0c6d9d2221c.tar.bz2 android_packages_apps_Gello-13198ac770e9d91d0035b513c8a5c0c6d9d2221c.zip |
Guard against null strings
Change-Id: I165c9fee57c0605b95751cc5875e6e6142e2001b
CR-Fixed: SWE-6070
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/browser/TabControl.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/com/android/browser/TabControl.java b/src/com/android/browser/TabControl.java index 00f3c44e..1d647d17 100644 --- a/src/com/android/browser/TabControl.java +++ b/src/com/android/browser/TabControl.java @@ -18,6 +18,7 @@ package com.android.browser; import android.net.Uri; import android.os.Bundle; +import android.text.TextUtils; import android.util.Log; import org.codeaurora.swe.GeolocationPermissions; @@ -47,9 +48,11 @@ class TabControl { */ public void findAndReload(String origin) { for (Tab tab : mTabs){ - if (tab.getWebView() != null) { - Uri url = Uri.parse(tab.getWebView().getUrl()); - if (url.getHost().equals(origin)){ + WebView wv = tab.getWebView(); + if (wv != null && !TextUtils.isEmpty(wv.getUrl())) { + Uri url = Uri.parse(wv.getUrl()); + if ((url != null && url.getHost() != null) && + url.getHost().equals(origin) ) { tab.getWebView().reload(); } } |