diff options
author | pacien | 2018-09-25 22:37:01 +0200 |
---|---|---|
committer | pacien | 2018-09-25 22:37:01 +0200 |
commit | c9b813a2c8fcd53543c7aa84a773915d2c7c07d1 (patch) | |
tree | 9bdd5583eae8fd841917811efb19e9e87f5bf15c | |
parent | 5f1d871e136b979278399c811ae7e3e0872a277f (diff) | |
download | tincapp-c9b813a2c8fcd53543c7aa84a773915d2c7c07d1.tar.gz |
Properly handle null list
-rw-r--r-- | app/src/main/java/org/pacien/tincapp/activities/status/networkinfo/VpnInterfaceConfigurationFormatter.kt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/src/main/java/org/pacien/tincapp/activities/status/networkinfo/VpnInterfaceConfigurationFormatter.kt b/app/src/main/java/org/pacien/tincapp/activities/status/networkinfo/VpnInterfaceConfigurationFormatter.kt index 568714e..2956cb4 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/status/networkinfo/VpnInterfaceConfigurationFormatter.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/status/networkinfo/VpnInterfaceConfigurationFormatter.kt | |||
@@ -28,8 +28,8 @@ import org.pacien.tincapp.data.CidrAddress | |||
28 | object VpnInterfaceConfigurationFormatter { | 28 | object VpnInterfaceConfigurationFormatter { |
29 | private val resources by lazy { App.getResources() } | 29 | private val resources by lazy { App.getResources() } |
30 | 30 | ||
31 | fun formatList(list: List<Any>) = when { | 31 | fun formatList(list: List<Any>?) = when { |
32 | list.isNotEmpty() -> list.joinToString("\n", transform = this::formatListElement) | 32 | list != null && list.isNotEmpty() -> list.joinToString("\n", transform = this::formatListElement) |
33 | else -> resources.getString(R.string.status_network_info_value_none)!! | 33 | else -> resources.getString(R.string.status_network_info_value_none)!! |
34 | } | 34 | } |
35 | 35 | ||