Merge pull request #46 from misogl/patch-1

Fix crash when changing flash mode on front camera
This commit is contained in:
Ran 2017-07-22 09:05:22 +03:00 committed by GitHub
commit 1faf1afee3
1 changed files with 2 additions and 1 deletions

View File

@ -54,7 +54,8 @@ public class CameraViewManager extends SimpleViewManager<CameraView> {
return false;
}
Camera.Parameters parameters = camera.getParameters();
if(parameters.getSupportedFlashModes().contains(mode)) {
List supportedModes = parameters.getSupportedFlashModes();
if (supportedModes != null && supportedModes.contains(mode)) {
flashMode = mode;
parameters.setFlashMode(flashMode);
camera.setParameters(parameters);