am 544450b4: Fix NPE in SuggestionsAdapter when cursor is null.

Merge commit '544450b4eee175c78a1ca8647a3bfaca4aecf47a'

* commit '544450b4eee175c78a1ca8647a3bfaca4aecf47a':
  Fix NPE in SuggestionsAdapter when cursor is null.
This commit is contained in:
Bjorn Bringert
2009-06-24 13:54:05 -07:00
committed by The Android Open Source Project

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