Fix NPE in SuggestionsAdapter when cursor is null.

Fixes http://b/issue?id=1940013
This commit is contained in:
Bjorn Bringert
2009-06-24 15:16:30 +01:00
parent 5f80605a0b
commit 544450b4ee

View File

@@ -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);