Avoid IllegalArgumentException crashlytics reported crash in CreateAccountFragment while generating a new brainkey.

This commit is contained in:
Severiano Jaramillo 2019-03-18 09:17:11 -06:00
parent a4537ae1c4
commit d0109c42d5

View file

@ -301,6 +301,12 @@ class CreateAccountFragment : BaseAccountFragment() {
} catch (e: IOException) { } catch (e: IOException) {
Log.e(TAG, "IOException while trying to generate key. Msg: " + e.message) Log.e(TAG, "IOException while trying to generate key. Msg: " + e.message)
context?.toast(getString(R.string.error__read_dict_file)) 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 { } finally {
if (reader != null) { if (reader != null) {
try { try {