wewewe718 / QrAndBarcodeScanner

An Android app for scanning QR codes and barcodes
The Unlicense
745 stars 143 forks source link

java.lang.StringIndexOutOfBoundsException when scanning a AZTEC code #149

Open ElishaAz opened 2 years ago

ElishaAz commented 2 years ago

I got a java.lang.StringIndexOutOfBoundsException when scanning a specific AZTEC code. I will not share it here, as it contains private information. Here is the stack trace:

java.lang.StringIndexOutOfBoundsException: length=149; index=149
        at java.lang.String.charAt(Native Method)
        at com.example.barcodescanner.model.schema.BoardingPass$Companion.parse(BoardingPass.kt:50)
        at com.example.barcodescanner.usecase.BarcodeParser.parseSchema(BarcodeParser.kt:26)
        at com.example.barcodescanner.usecase.BarcodeParser.parseResult(BarcodeParser.kt:12)
        at com.example.barcodescanner.feature.tabs.scan.ScanBarcodeFromCameraFragment.handleScannedBarcode(ScanBarcodeFromCameraFragment.kt:240)
        at com.example.barcodescanner.feature.tabs.scan.ScanBarcodeFromCameraFragment.$r8$lambda$rHL_73-k4ZYCMBygp3TtPOjHzhc(Unknown Source:0)
        at com.example.barcodescanner.feature.tabs.scan.ScanBarcodeFromCameraFragment$$ExternalSyntheticLambda5.onDecoded(Unknown Source:2)
        at com.budiyev.android.codescanner.Decoder$DecoderThread.run(Decoder.java:141)

The app crashes immediately after scanning, every time.

Ferguson44 commented 2 years ago

9