fun getLocationOrNull()

in src/main/kotlin/org/jetbrains/plugins/template/weatherApp/ui/WeatherAppViewModel.kt [68:75]


    fun getLocationOrNull(): Location? {
        return when (this) {
            Empty -> null
            is Error -> location
            is Loading -> location
            is Success -> weatherForecastData.location
        }
    }