mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-04-14 19:56:32 +00:00
fix potential crashes
This commit is contained in:
parent
5445d54c43
commit
b67d6c3edf
2 changed files with 9 additions and 2 deletions
|
|
@ -209,7 +209,11 @@ class ChallengeFormActivity : BaseActivity() {
|
|||
val bundle = intent.extras
|
||||
|
||||
challengeTasks = ChallengeTasksRecyclerViewAdapter(null, 0, this, "", null, false, true)
|
||||
compositeSubscription.add(challengeTasks.taskOpenEvents.subscribe { openNewTaskActivity(it.type, it) })
|
||||
compositeSubscription.add(challengeTasks.taskOpenEvents.subscribe {
|
||||
if (it.isValid) {
|
||||
openNewTaskActivity(it.type, it)
|
||||
}
|
||||
})
|
||||
locationAdapter = GroupArrayAdapter(this)
|
||||
|
||||
if (bundle != null) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.habitrpg.android.habitica.ui.views.dialogs
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
|
|
@ -215,7 +216,9 @@ open class HabiticaAlertDialog(context: Context) : AlertDialog(context, R.style.
|
|||
dialogQueue.removeAt(0)
|
||||
}
|
||||
if (dialogQueue.size > 0) {
|
||||
dialogQueue[0].show()
|
||||
if ((dialogQueue[0].context as? Activity)?.isFinishing == false) {
|
||||
dialogQueue[0].show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue