summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhuiwan <huiwan@codeaurora.org>2016-08-16 10:16:31 +0800
committerArne Coucheron <arco68@gmail.com>2017-07-15 06:51:07 +0200
commit549a40db66eb75b10066212ad4bef42fae2deccf (patch)
tree2c11a849ff447de675d3d380e0e997e195597778
parent74e102d5eebd18a8a1e65c21cf91671bc92a9ec7 (diff)
downloadandroid_packages_apps_Trebuchet-549a40db66eb75b10066212ad4bef42fae2deccf.tar.gz
android_packages_apps_Trebuchet-549a40db66eb75b10066212ad4bef42fae2deccf.tar.bz2
android_packages_apps_Trebuchet-549a40db66eb75b10066212ad4bef42fae2deccf.zip
Fix requestFocus()' on a null object reference
Runtime exception when resume the Launcher, the requestFocus called on null pointer reference. Change-Id: I9cad959bb6ae1228ddf576720316a30e22cc8222 CRs-fixed: 1052687
-rw-r--r--src/com/android/launcher3/Launcher.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 26a739dca..afacfc8f3 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -3980,7 +3980,8 @@ public class Launcher extends Activity
}
if (mSavedState != null) {
if (!mWorkspace.hasFocus()) {
- mWorkspace.getChildAt(mWorkspace.getCurrentPage()).requestFocus();
+ View v = mWorkspace.getChildAt(mWorkspace.getCurrentPage());
+ if (v != null) v.requestFocus();
}
mSavedState = null;