summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoris Liu <tianliu@google.com>2013-03-06 11:22:48 -0800
committerDoris Liu <tianliu@google.com>2013-03-06 11:23:29 -0800
commit8892e5e7ffa1f33b527b7753b07723dfd685a9cd (patch)
treee47540b58771f46da2d74ee54e8b95e5ed4df699
parentf831c736a3c0c20b59873d98f8abe5b2a234f402 (diff)
downloadandroid_packages_apps_Gallery2-8892e5e7ffa1f33b527b7753b07723dfd685a9cd.tar.gz
android_packages_apps_Gallery2-8892e5e7ffa1f33b527b7753b07723dfd685a9cd.tar.bz2
android_packages_apps_Gallery2-8892e5e7ffa1f33b527b7753b07723dfd685a9cd.zip
Fix NPE in switcher popup
Bug: 8327966 Change-Id: I4181a59871c065435756c100b3e8b43930781ee5
-rw-r--r--src/com/android/camera/ui/CameraSwitcher.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/com/android/camera/ui/CameraSwitcher.java b/src/com/android/camera/ui/CameraSwitcher.java
index 897729b46..326416a97 100644
--- a/src/com/android/camera/ui/CameraSwitcher.java
+++ b/src/com/android/camera/ui/CameraSwitcher.java
@@ -140,7 +140,7 @@ public class CameraSwitcher extends RotateImageView
item.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
- onCameraSelected(index);
+ if (showsPopup()) onCameraSelected(index);
}
});
switch (mDrawIds[i]) {
@@ -271,7 +271,7 @@ public class CameraSwitcher extends RotateImageView
@Override
public void onAnimationEnd(Animator animation) {
// Verify that we weren't canceled
- if (!showsPopup()) {
+ if (!showsPopup() && mPopup != null) {
mPopup.setVisibility(View.INVISIBLE);
((ViewGroup) mParent).removeView(mPopup);
mPopup = null;