From 77665404048135a5a96d709378d6f55518b868e2 Mon Sep 17 00:00:00 2001 From: Wu-cheng Li Date: Wed, 16 Nov 2011 14:35:43 +0800 Subject: Fix NPE if the device has only one camera. bug:5620872 Change-Id: I4ee2aa85e73c53d6a72f0839ed3bf31bc14c586e --- src/com/android/camera/ui/IndicatorControlBar.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/com/android/camera/ui/IndicatorControlBar.java b/src/com/android/camera/ui/IndicatorControlBar.java index 197c594..615a5ba 100644 --- a/src/com/android/camera/ui/IndicatorControlBar.java +++ b/src/com/android/camera/ui/IndicatorControlBar.java @@ -57,7 +57,9 @@ public class IndicatorControlBar extends IndicatorControl implements // Add CameraPicker control. initializeCameraPicker(); - mCameraPicker.setBackgroundResource(R.drawable.bg_pressed); + if (mCameraPicker != null) { + mCameraPicker.setBackgroundResource(R.drawable.bg_pressed); + } // Add the ZoomControl if supported. if (zoomSupported) { -- cgit v1.1