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

master
Severiano Jaramillo 2019-03-18 09:17:11 -06:00
parent a4537ae1c4
commit d0109c42d5
1 changed files with 6 additions and 0 deletions

View File

@ -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 {