From 143b6a011d5123d035f6750b7035c1769c1cdcc6 Mon Sep 17 00:00:00 2001 From: Severiano Jaramillo Date: Sun, 17 Mar 2019 09:38:36 -0600 Subject: [PATCH] Avoid three crashlytics reported crashes due to unhandled errors in RxJava operations in the ImportBrainkeyFragment. --- .../fragments/ImportBrainkeyFragment.kt | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/ImportBrainkeyFragment.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/ImportBrainkeyFragment.kt index 7c9f034..0863a86 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/ImportBrainkeyFragment.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/ImportBrainkeyFragment.kt @@ -91,7 +91,10 @@ class ImportBrainkeyFragment : BaseAccountFragment() { .skipInitialValue() .debounce(500, TimeUnit.MILLISECONDS) .observeOn(AndroidSchedulers.mainThread()) - .subscribe { validatePIN() } + .subscribe( + { validatePIN() }, + { Crashlytics.log(Log.DEBUG, TAG, it.message) } + ) ) // Use RxJava Debounce to update the PIN Confirmation error only after the user stops writing for > 500 ms @@ -100,7 +103,10 @@ class ImportBrainkeyFragment : BaseAccountFragment() { .skipInitialValue() .debounce(500, TimeUnit.MILLISECONDS) .observeOn(AndroidSchedulers.mainThread()) - .subscribe { validatePINConfirmation() } + .subscribe( + { validatePINConfirmation() }, + { Crashlytics.log(Log.DEBUG, TAG, it.message) } + ) ) // Use RxJava Debounce to update the BrainKey error only after the user stops writing for > 500 ms @@ -110,7 +116,10 @@ class ImportBrainkeyFragment : BaseAccountFragment() { .debounce(500, TimeUnit.MILLISECONDS) .map { it.toString().trim() } .observeOn(AndroidSchedulers.mainThread()) - .subscribe { validateBrainKey(it) } + .subscribe( + { validateBrainKey(it) }, + { Crashlytics.log(Log.DEBUG, TAG, it.message) } + ) ) btnImport.isEnabled = false