From d6562a301674c3ca1315a9cf252e2ccd2edfaf10 Mon Sep 17 00:00:00 2001 From: Oleksandr Sarapulov Date: Mon, 19 Jul 2021 13:38:51 +0300 Subject: [PATCH] Fixed to ignore QR codes that don't have country prefixes --- .../app/android/verification/VerificationViewModel.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/dgca/verifier/app/android/verification/VerificationViewModel.kt b/app/src/main/java/dgca/verifier/app/android/verification/VerificationViewModel.kt index b31cdc1d..caadfb00 100644 --- a/app/src/main/java/dgca/verifier/app/android/verification/VerificationViewModel.kt +++ b/app/src/main/java/dgca/verifier/app/android/verification/VerificationViewModel.kt @@ -117,6 +117,10 @@ class VerificationViewModel @Inject constructor( var isApplicableCode = false withContext(Dispatchers.IO) { val plainInput = prefixValidationService.decode(code, verificationResult) + if (verificationResult.contextPrefix.isNullOrBlank()) { + Timber.d("Verification failed: Proper prefix is missing") + return@withContext + } val compressedCose = base45Service.decode(plainInput, verificationResult) val cose = compressorService.decode(compressedCose, verificationResult)