From ec9e531a63e193af4e90048f7faee3ef5904c6b7 Mon Sep 17 00:00:00 2001 From: Gabriele M Date: Sat, 16 Jan 2016 00:10:32 +0100 Subject: Trebuchet: Fix NPE when app search controller is off Change-Id: Ia6a9322e0aee3e16d4dd864fbc5a341e3f0501a8 --- src/com/android/launcher3/allapps/AllAppsContainerView.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java index 18030b451..0e3cba83e 100644 --- a/src/com/android/launcher3/allapps/AllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java @@ -502,7 +502,8 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc public boolean dispatchKeyEvent(KeyEvent event) { // Determine if the key event was actual text, if so, focus the search bar and then dispatch // the key normally so that it can process this key event - if (!mSearchBarController.isSearchFieldFocused() && + if (mSearchBarController != null && + !mSearchBarController.isSearchFieldFocused() && event.getAction() == KeyEvent.ACTION_DOWN) { final int unicodeChar = event.getUnicodeChar(); final boolean isKeyNotWhitespace = unicodeChar > 0 && -- cgit v1.2.3