From 544450b4eee175c78a1ca8647a3bfaca4aecf47a Mon Sep 17 00:00:00 2001 From: Bjorn Bringert Date: Wed, 24 Jun 2009 15:16:30 +0100 Subject: [PATCH] Fix NPE in SuggestionsAdapter when cursor is null. Fixes http://b/issue?id=1940013 --- core/java/android/app/SuggestionsAdapter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/java/android/app/SuggestionsAdapter.java b/core/java/android/app/SuggestionsAdapter.java index 0bdb10b505635..49c94d12f8d03 100644 --- a/core/java/android/app/SuggestionsAdapter.java +++ b/core/java/android/app/SuggestionsAdapter.java @@ -147,7 +147,7 @@ class SuggestionsAdapter extends ResourceCursorAdapter { final Cursor cursor = mSearchManager.getSuggestions(mSearchable, query); // trigger fill window so the spinner stays up until the results are copied over and // closer to being ready - if (!mGlobalSearchMode) cursor.getCount(); + if (!mGlobalSearchMode && cursor != null) cursor.getCount(); return cursor; } catch (RuntimeException e) { Log.w(LOG_TAG, "Search suggestions query threw an exception.", e);