From 8833ac10c3f650c71a2d8dea9f9bc698eacd8b16 Mon Sep 17 00:00:00 2001 From: Kody Fintak <15849743+KodyFintak@users.noreply.github.com> Date: Thu, 30 Mar 2023 05:26:03 -0400 Subject: [PATCH] fix: Fix `Failed to parse camera Id` error by ignoring non-integer cameras (#1428) --- android/src/main/java/com/mrousavy/camera/CameraViewModule.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/java/com/mrousavy/camera/CameraViewModule.kt b/android/src/main/java/com/mrousavy/camera/CameraViewModule.kt index 7672b15..fb85308 100644 --- a/android/src/main/java/com/mrousavy/camera/CameraViewModule.kt +++ b/android/src/main/java/com/mrousavy/camera/CameraViewModule.kt @@ -181,7 +181,7 @@ class CameraViewModule(reactContext: ReactApplicationContext) : ReactContextBase val cameraDevices: WritableArray = Arguments.createArray() - manager.cameraIdList.forEach loop@{ id -> + manager.cameraIdList.filter{ id -> id.toIntOrNull() != null }.forEach loop@{ id -> val cameraSelector = CameraSelector.Builder().byID(id).build() val characteristics = manager.getCameraCharacteristics(id)