mirror of
https://github.com/ultrasonic/ultrasonic
synced 2025-02-15 03:00:52 +01:00
Updated missing index handling
This commit is contained in:
parent
02716c827a
commit
db4f8b83d3
@ -85,8 +85,10 @@ internal class ServerRowAdapter(
|
||||
text?.text = context.getString(R.string.main_offline)
|
||||
description?.text = ""
|
||||
} else {
|
||||
text?.text = data.singleOrNull { setting -> setting.index == index }?.name ?: ""
|
||||
description?.text = data.singleOrNull { setting -> setting.index == index }?.url ?: ""
|
||||
val setting = data.singleOrNull { t -> t.index == index }
|
||||
text?.text = setting?.name ?: ""
|
||||
description?.text = setting?.url ?: ""
|
||||
if (setting == null) serverMenu?.visibility = View.INVISIBLE
|
||||
}
|
||||
|
||||
// Provide icons for the row
|
||||
|
@ -75,7 +75,7 @@ class ActiveServerProvider(
|
||||
}
|
||||
|
||||
GlobalScope.launch(Dispatchers.IO) {
|
||||
val serverId = repository.findByIndex(index)!!.id
|
||||
val serverId = repository.findByIndex(index)?.id ?: 0
|
||||
setActiveServerId(context, serverId)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user