mirror of
				https://github.com/oxen-io/session-android.git
				synced 2025-11-04 01:01:22 +00:00 
			
		
		
		
	Fix crash
This commit is contained in:
		@@ -142,7 +142,11 @@ class PathActivity : PassphraseRequiredActionBarActivity() {
 | 
			
		||||
 | 
			
		||||
    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 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)
 | 
			
		||||
    }
 | 
			
		||||
    // endregion
 | 
			
		||||
 
 | 
			
		||||
@@ -29,8 +29,10 @@ class IP2Country private constructor(private val context: Context) {
 | 
			
		||||
 | 
			
		||||
        public lateinit var shared: IP2Country
 | 
			
		||||
 | 
			
		||||
        public val isInitialized: Boolean get() = ::shared.isInitialized
 | 
			
		||||
 | 
			
		||||
        public fun configureIfNeeded(context: Context) {
 | 
			
		||||
            if (::shared.isInitialized) { return; }
 | 
			
		||||
            if (isInitialized) { return; }
 | 
			
		||||
            shared = IP2Country(context)
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user