From d0109c42d5a3716736f5061bbd41262a02a2ea27 Mon Sep 17 00:00:00 2001 From: Severiano Jaramillo Date: Mon, 18 Mar 2019 09:17:11 -0600 Subject: [PATCH] Avoid IllegalArgumentException crashlytics reported crash in CreateAccountFragment while generating a new brainkey. --- .../bitsybitshareswallet/fragments/CreateAccountFragment.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/CreateAccountFragment.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/CreateAccountFragment.kt index 00a6abb..49237a6 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/CreateAccountFragment.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/CreateAccountFragment.kt @@ -301,6 +301,12 @@ class CreateAccountFragment : BaseAccountFragment() { } catch (e: IOException) { Log.e(TAG, "IOException while trying to generate key. Msg: " + e.message) context?.toast(getString(R.string.error__read_dict_file)) + findNavController().navigateUp() + } catch (e: IllegalArgumentException) { + Crashlytics.logException(e) + // TODO if this does happen to real devices, use a proper error message + context?.toast(getString(R.string.error__try_again)) + findNavController().navigateUp() } finally { if (reader != null) { try {