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

Commit 7254afd4 authored by Kenny Root's avatar Kenny Root
Browse files

Ensure adapter is not null in AutoCompleteTextView

A runnable is posted for AutoCompleteTextView's PopupDataSetObserver, but
there's a possibility that mAdapter would be set to null between when
the runnable is run and the time it is posted.

This fixes a monkey crash seen in build 29176.

Change-Id: Ie7be51db580d6e9775533890e5f6902409bec84d
MonkeyCrashID: 2071507494::1632:123:521
parent b05ec118
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1629,7 +1629,10 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe
                // of iterating throught he list of observers.
                post(new Runnable() {
                    public void run() {
                        updateDropDownForFilter(mAdapter.getCount());
                        final ListAdapter adapter = mAdapter;
                        if (adapter != null) {
                            updateDropDownForFilter(adapter.getCount());
                        }
                    }
                });
            }