mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 20:15:21 +00:00
Fix crash
This commit is contained in:
parent
38464bf1f7
commit
e1841db991
@ -142,7 +142,11 @@ class PathActivity : PassphraseRequiredActionBarActivity() {
|
|||||||
|
|
||||||
private fun getPathRow(snode: Snode, location: LineView.Location, dotAnimationStartDelay: Long, dotAnimationRepeatInterval: Long, isGuardSnode: Boolean): LinearLayout {
|
private fun getPathRow(snode: Snode, location: LineView.Location, dotAnimationStartDelay: Long, dotAnimationRepeatInterval: Long, isGuardSnode: Boolean): LinearLayout {
|
||||||
val title = if (isGuardSnode) resources.getString(R.string.activity_path_guard_node_row_title) else resources.getString(R.string.activity_path_service_node_row_title)
|
val title = if (isGuardSnode) resources.getString(R.string.activity_path_guard_node_row_title) else resources.getString(R.string.activity_path_service_node_row_title)
|
||||||
val subtitle = IP2Country.shared.countryNamesCache[snode.ip] ?: "Resolving..."
|
val subtitle = if (IP2Country.isInitialized) {
|
||||||
|
IP2Country.shared.countryNamesCache[snode.ip] ?: "Resolving..."
|
||||||
|
} else {
|
||||||
|
"Resolving..."
|
||||||
|
}
|
||||||
return getPathRow(title, subtitle, location, dotAnimationStartDelay, dotAnimationRepeatInterval)
|
return getPathRow(title, subtitle, location, dotAnimationStartDelay, dotAnimationRepeatInterval)
|
||||||
}
|
}
|
||||||
// endregion
|
// endregion
|
||||||
|
@ -29,8 +29,10 @@ class IP2Country private constructor(private val context: Context) {
|
|||||||
|
|
||||||
public lateinit var shared: IP2Country
|
public lateinit var shared: IP2Country
|
||||||
|
|
||||||
|
public val isInitialized: Boolean get() = ::shared.isInitialized
|
||||||
|
|
||||||
public fun configureIfNeeded(context: Context) {
|
public fun configureIfNeeded(context: Context) {
|
||||||
if (::shared.isInitialized) { return; }
|
if (isInitialized) { return; }
|
||||||
shared = IP2Country(context)
|
shared = IP2Country(context)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user