Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4d891d17 authored by Mark Wagner's avatar Mark Wagner
Browse files

don't assume Cursor.getExtras returns non-null

parent d1974312
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.StateListDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.TextUtils;
@@ -203,15 +204,16 @@ class SuggestionsAdapter extends ResourceCursorAdapter {
    }

    private void updateSpinnerState(Cursor cursor) {
        Bundle extras = cursor != null ? cursor.getExtras() : null;
        if (DBG) {
            Log.d(LOG_TAG, "updateSpinnerState - extra = "
                + (cursor != null
                        ? cursor.getExtras().getBoolean(SearchManager.CURSOR_EXTRA_KEY_IN_PROGRESS)
                + (extras != null
                        ? extras.getBoolean(SearchManager.CURSOR_EXTRA_KEY_IN_PROGRESS)
                        : null));
        }
        // Check if the Cursor indicates that the query is not complete and show the spinner
        if (cursor != null
                && cursor.getExtras().getBoolean(SearchManager.CURSOR_EXTRA_KEY_IN_PROGRESS)) {
        if (extras != null
                && extras.getBoolean(SearchManager.CURSOR_EXTRA_KEY_IN_PROGRESS)) {
            mSearchDialog.getWindow().getDecorView().post(mStartSpinnerRunnable);
            return;
        }