mirror of
https://github.com/etesync/android
synced 2024-12-23 07:08:16 +00:00
Fix crashes.
This commit is contained in:
parent
f382115128
commit
4485fdbb08
@ -90,7 +90,7 @@ class AccountSettingsFragment() : PreferenceFragmentCompat(), LoaderManager.Load
|
|||||||
|
|
||||||
override fun onLoadFinished(loader: Loader<AccountSettings>, settings: AccountSettings?) {
|
override fun onLoadFinished(loader: Loader<AccountSettings>, settings: AccountSettings?) {
|
||||||
if (settings == null) {
|
if (settings == null) {
|
||||||
activity!!.finish()
|
activity?.finish()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// Category: dashboard
|
// Category: dashboard
|
||||||
@ -107,12 +107,15 @@ class AccountSettingsFragment() : PreferenceFragmentCompat(), LoaderManager.Load
|
|||||||
}
|
}
|
||||||
} catch (e: EtebaseException) {
|
} catch (e: EtebaseException) {
|
||||||
uiThread {
|
uiThread {
|
||||||
AlertDialog.Builder(requireContext())
|
val context = context
|
||||||
.setIcon(R.drawable.ic_error_dark)
|
if (context != null) {
|
||||||
.setTitle(R.string.exception)
|
AlertDialog.Builder(context)
|
||||||
.setMessage(e.localizedMessage)
|
.setIcon(R.drawable.ic_error_dark)
|
||||||
.setPositiveButton(android.R.string.yes) { _, _ -> }
|
.setTitle(R.string.exception)
|
||||||
.show()
|
.setMessage(e.localizedMessage)
|
||||||
|
.setPositiveButton(android.R.string.yes) { _, _ -> }
|
||||||
|
.show()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user