From 0e11c67dfdb0445d06c6f996ea6d729a686dd91b Mon Sep 17 00:00:00 2001 From: Severiano Jaramillo Date: Sat, 16 Mar 2019 21:32:27 -0600 Subject: [PATCH] Avoid crash in ReceiveTransactionFragment due to an unhandled error in RxJava operators. --- .../fragments/ReceiveTransactionFragment.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/ReceiveTransactionFragment.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/ReceiveTransactionFragment.kt index 236a901..dc65723 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/ReceiveTransactionFragment.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/ReceiveTransactionFragment.kt @@ -80,7 +80,7 @@ class ReceiveTransactionFragment : ConnectedFragment() { private var selectedInAutoCompleteTextView = false // Map used to keep track of request and response id pairs - private val responseMap = LongSparseArray()//HashMap() + private val responseMap = LongSparseArray() override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { setHasOptionsMenu(true) @@ -173,6 +173,7 @@ class ReceiveTransactionFragment : ConnectedFragment() { tietAmount.textChanges() .debounce(1000, TimeUnit.MILLISECONDS) .observeOn(AndroidSchedulers.mainThread()) + .doOnError { mAsset = null } .subscribe { updateQR() } ) @@ -188,6 +189,7 @@ class ReceiveTransactionFragment : ConnectedFragment() { .debounce(500, TimeUnit.MILLISECONDS) .map { it.toString().trim().toUpperCase() } .observeOn(AndroidSchedulers.mainThread()) + .doOnError { mAsset = null } .subscribe { if (!selectedInAutoCompleteTextView) { mAsset = null