From 6661a3dfdc3ca024579446ee43172aa4c4d1b507 Mon Sep 17 00:00:00 2001 From: Sergio De la torre Date: Thu, 9 Nov 2023 15:56:59 +0100 Subject: [PATCH] refs #5313 fix:crashlytics errors --- .../collection/fragment/ShowTicketFragment.kt | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/ShowTicketFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/ShowTicketFragment.kt index f3d525d0..c263c289 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/ShowTicketFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/ShowTicketFragment.kt @@ -184,13 +184,18 @@ class CollectionShowTicketFragment( binding.scanInput.setOnEditorActionListener { _, actionId, _ -> if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {//ID=0 ACTION_NEXT ID=5 ACTION_UNESPECEFIED) if (!binding.scanInput.text.toString().isNullOrEmpty()) { - binding.splashProgress.visibility = VISIBLE - viewModel.collectionTicketGet( - binding.scanInput.text.toString().toInt(), - getDataInt(SECTORFK), - print = "0", - type - ) + + try{ + viewModel.collectionTicketGet( + binding.scanInput.text.toString().toInt(), + getDataInt(SECTORFK), + print = "0", + type + ) + binding.splashProgress.visibility = VISIBLE + }catch (ex:Exception){ + getString(R.string.scanLabelTicket).toast(requireContext()) + } }