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()) + } }