Jon West | 013ef58 | 2018-08-21 20:45:26 -0400 | [diff] [blame^] | 1 | From ec657f31e92f4a58791a39025632f0350a7750db Mon Sep 17 00:00:00 2001 |
| 2 | From: Pierre-Hugues Husson <phh@phh.me> |
| 3 | Date: Sun, 19 Aug 2018 23:05:26 +0200 |
| 4 | Subject: [PATCH 4/4] We might not have a mFlashlight at this state, but that's |
| 5 | ok |
| 6 | |
| 7 | --- |
| 8 | services/camera/libcameraservice/CameraService.cpp | 2 +- |
| 9 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 10 | |
| 11 | diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp |
| 12 | index edbafbc..222cfe4 100644 |
| 13 | --- a/services/camera/libcameraservice/CameraService.cpp |
| 14 | +++ b/services/camera/libcameraservice/CameraService.cpp |
| 15 | @@ -243,7 +243,7 @@ void CameraService::addStates(const String8 id) { |
| 16 | conflicting)); |
| 17 | } |
| 18 | |
| 19 | - if (mFlashlight->hasFlashUnit(id)) { |
| 20 | + if (mFlashlight != nullptr && mFlashlight->hasFlashUnit(id)) { |
| 21 | Mutex::Autolock al(mTorchStatusMutex); |
| 22 | mTorchStatusMap.add(id, TorchModeStatus::AVAILABLE_OFF); |
| 23 | } |
| 24 | -- |
| 25 | 2.7.4 |
| 26 | |