diff --git a/android/src/main/java/com/nateshmbhat/card_scanner/CardScannerCameraActivity.kt b/android/src/main/java/com/nateshmbhat/card_scanner/CardScannerCameraActivity.kt index ad8cad7..1bd5800 100644 --- a/android/src/main/java/com/nateshmbhat/card_scanner/CardScannerCameraActivity.kt +++ b/android/src/main/java/com/nateshmbhat/card_scanner/CardScannerCameraActivity.kt @@ -38,7 +38,7 @@ class CardScannerCameraActivity : AppCompatActivity() { private var cameraSelector: CameraSelector? = null private var textRecognizer: TextRecognizer? = null private var analysisUseCase: ImageAnalysis? = null - private lateinit var cardScannerOptions: CardScannerOptions? = null + private var cardScannerOptions: CardScannerOptions? = null private lateinit var cameraExecutor: ExecutorService lateinit var animator: ObjectAnimator lateinit var scannerLayout: View diff --git a/android/src/main/java/com/nateshmbhat/card_scanner/logger/Logger.kt b/android/src/main/java/com/nateshmbhat/card_scanner/logger/Logger.kt index 0840fbf..4d58271 100644 --- a/android/src/main/java/com/nateshmbhat/card_scanner/logger/Logger.kt +++ b/android/src/main/java/com/nateshmbhat/card_scanner/logger/Logger.kt @@ -3,7 +3,11 @@ package com.nateshmbhat.card_scanner.logger import android.util.Log import com.nateshmbhat.card_scanner.scanner_core.models.CardScannerOptions -fun debugLog(message: String, scannerOptions: CardScannerOptions, tag: String = "card_scanner_debug_log") { +fun debugLog(message: String, scannerOptions: CardScannerOptions?, tag: String = "card_scanner_debug_log") { + if(scannerOptions == null) { + return + } + if (scannerOptions.enableDebugLogs) { Log.d(tag, message) }