mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-07-13 17:51:57 +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
|
val bundle = intent.extras
|
||||||
|
|
||||||
challengeTasks = ChallengeTasksRecyclerViewAdapter(null, 0, this, "", null, false, true)
|
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)
|
locationAdapter = GroupArrayAdapter(this)
|
||||||
|
|
||||||
if (bundle != null) {
|
if (bundle != null) {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.habitrpg.android.habitica.ui.views.dialogs
|
package com.habitrpg.android.habitica.ui.views.dialogs
|
||||||
|
|
||||||
|
import android.app.Activity
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
|
@ -215,7 +216,9 @@ open class HabiticaAlertDialog(context: Context) : AlertDialog(context, R.style.
|
||||||
dialogQueue.removeAt(0)
|
dialogQueue.removeAt(0)
|
||||||
}
|
}
|
||||||
if (dialogQueue.size > 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