From 5981246a55ed59a194cf607fe980ff4412dca4e2 Mon Sep 17 00:00:00 2001 From: mariakhomenko Date: Tue, 11 Aug 2015 14:47:43 -0700 Subject: [PATCH] Speculative crash fix. Check that native autocomplete controller hasn't been destroyed before calling classify. BUG=492509 Review URL: https://codereview.chromium.org/1277713003 Cr-Commit-Position: refs/heads/master@{#342905} --- .../org/chromium/chrome/browser/omnibox/AutocompleteController.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/AutocompleteController.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/AutocompleteController.java index 392968c7b245..ee0ebd7594ab 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/AutocompleteController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/AutocompleteController.java @@ -119,7 +119,10 @@ public class AutocompleteController { * be null if the input is invalid. */ public OmniboxSuggestion classify(String text) { - return nativeClassify(mNativeAutocompleteControllerAndroid, text); + if (mNativeAutocompleteControllerAndroid != 0) { + return nativeClassify(mNativeAutocompleteControllerAndroid, text); + } + return null; } /** -- 2.11.4.GIT