Skip to content

Commit 52f2046

Browse files
committed
Fix crash on invalid QR code
1 parent 9c7e134 commit 52f2046

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/src/main/java/cz/muni/fi/rpg/ui/joinParty/QrCodeScannerAnalyser.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import android.graphics.ImageFormat
55
import androidx.camera.core.ImageAnalysis
66
import androidx.camera.core.ImageProxy
77
import com.google.zxing.BinaryBitmap
8-
import com.google.zxing.NotFoundException
98
import com.google.zxing.PlanarYUVLuminanceSource
9+
import com.google.zxing.ReaderException
1010
import com.google.zxing.common.HybridBinarizer
1111
import com.google.zxing.qrcode.QRCodeReader
1212
import timber.log.Timber
@@ -60,7 +60,7 @@ class QrCodeScannerAnalyser(
6060

6161
val result = reader.decode(binaryBitmap)
6262
onQrCodesDetected(result.text)
63-
} catch (e: NotFoundException) {
63+
} catch (e: ReaderException) {
6464
Timber.d(e)
6565
} finally {
6666
imageProxy.close()

0 commit comments

Comments
 (0)