Fixed empty history list crash

This commit is contained in:
Corewala 2022-01-07 16:22:35 -05:00
parent 9ed34ece8f
commit 36e2151c9f
1 changed files with 5 additions and 1 deletions

View File

@ -1,6 +1,7 @@
package corewala.buran
import android.net.Uri
import corewala.buran.Buran.Companion.DEFAULT_HOME_CAPSULE
import java.util.*
const val GEM_SCHEME = "gemini://"
@ -81,7 +82,10 @@ class OmniTerm(private val listener: Listener) {
}
fun getCurrent(): String {
return history.last().toString()
if (history.isNotEmpty()){
return history.last().toString()
}
return DEFAULT_HOME_CAPSULE
}
fun canGoBack(): Boolean {