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

Commit 0f55b197 authored by Amith Yamasani's avatar Amith Yamasani
Browse files

Fix an NPE in SearchDialog when clicking on Mic button. Bug: 2410605

parent 57853a8a
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -903,15 +903,14 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS
            if (mSearchable == null) {
                return;
            }
            try {
            SearchableInfo searchable = mSearchable;
            // First stop the existing search before starting voice search, or else we'll end
            // up showing the search dialog again once we return to the app.
                ((SearchManager) getContext().getSystemService(Context.SEARCH_SERVICE)).
                        stopSearch();
                
                if (mSearchable.getVoiceSearchLaunchWebSearch()) {
            cancel();
            try {
                if (searchable.getVoiceSearchLaunchWebSearch()) {
                    getContext().startActivity(mVoiceWebSearchIntent);
                } else if (mSearchable.getVoiceSearchLaunchRecognizer()) {
                } else if (searchable.getVoiceSearchLaunchRecognizer()) {
                    Intent appSearchIntent = createVoiceAppSearchIntent(mVoiceAppSearchIntent);                    
                    getContext().startActivity(appSearchIntent);
                }