Fix: ignore irrelevant crashes while closing the camera.

This commit is contained in:
Kevin Gorham 2020-03-26 09:42:16 -04:00
parent f724a74993
commit 436fa5fa74
No known key found for this signature in database
GPG Key ID: CCA55602DF49FC38
1 changed files with 1 additions and 1 deletions

View File

@ -54,7 +54,7 @@ class QrAnalyzer(val scanCallback: (qrContent: String, image: ImageProxy) -> Uni
private fun onImageScan(result: List<FirebaseVisionBarcode>, image: ImageProxy) {
result.firstOrNull()?.rawValue?.let {
scanCallback(it, image)
} ?: image.close()
} ?: runCatching { image.close() }
}
private fun onImageScanFailure(e: Exception) {