diff --git a/core-lib/src/main/java/org/idpass/smartscanner/lib/SmartScannerActivity.kt b/core-lib/src/main/java/org/idpass/smartscanner/lib/SmartScannerActivity.kt
index 49d3c721..c0a2705c 100644
--- a/core-lib/src/main/java/org/idpass/smartscanner/lib/SmartScannerActivity.kt
+++ b/core-lib/src/main/java/org/idpass/smartscanner/lib/SmartScannerActivity.kt
@@ -412,6 +412,7 @@ class SmartScannerActivity : BaseActivity(), OnClickListener {
@SuppressLint("ClickableViewAccessibility", "UnsafeOptInUsageError")
private fun startCamera(analyzer: ImageAnalysis.Analyzer? = null, hasPDF417: Boolean = false) {
viewFinder.post {
+ if (viewFinder.display == null) return@post
this.getSystemService(Context.CAMERA_SERVICE) as CameraManager
val cameraProviderFuture = ProcessCameraProvider.getInstance(this)
cameraProviderFuture.addListener({
diff --git a/core-lib/src/main/res/layout-land/activity_smart_scanner.xml b/core-lib/src/main/res/layout-land/activity_smart_scanner.xml
index 8d574a1a..bff5aadf 100644
--- a/core-lib/src/main/res/layout-land/activity_smart_scanner.xml
+++ b/core-lib/src/main/res/layout-land/activity_smart_scanner.xml
@@ -98,6 +98,19 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
+
+