fix: Fix Failed to parse camera Id error by ignoring non-integer cameras (#1428)

This commit is contained in:
Kody Fintak 2023-03-30 05:26:03 -04:00 committed by GitHub
parent ba099e4044
commit 8833ac10c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)