Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(562)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java

Issue 1487923002: [Contextual Search] Fix NPE when no Search Term. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2564
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java
index beaff0f6f6b3611522e0986bbf1212a934e72e8d..a8f3a97d586ab533c9d205a2d74feac902cfc58d 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java
@@ -6,6 +6,7 @@ package org.chromium.chrome.browser.contextualsearch;
import android.app.Activity;
import android.content.Context;
+import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
@@ -731,7 +732,7 @@ public class ContextualSearchManager extends ContextualSearchObservable
alternateTerm = null;
doPreventPreload = true;
}
- if (!searchTerm.isEmpty()) {
+ if (!TextUtils.isEmpty(searchTerm)) {
// TODO(donnd): Instead of preloading, we should prefetch (ie the URL should not
// appear in the user's history until the user views it). See crbug.com/406446.
boolean shouldPreload = !doPreventPreload && mPolicy.shouldPrefetchSearchResult(true);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698