From 87c9efce4a65cee0f48bc944048609c7b385de79 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 19 Mar 2020 13:01:51 -0600 Subject: [PATCH] TunnelListFragment: catch all parsing exceptions Otherwise we crash if weird things happen. Reported-by: Luis Ressel Signed-off-by: Jason A. Donenfeld --- .../com/wireguard/android/fragment/TunnelListFragment.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ui/src/main/java/com/wireguard/android/fragment/TunnelListFragment.kt b/ui/src/main/java/com/wireguard/android/fragment/TunnelListFragment.kt index 78c98161..cb3636fe 100644 --- a/ui/src/main/java/com/wireguard/android/fragment/TunnelListFragment.kt +++ b/ui/src/main/java/com/wireguard/android/fragment/TunnelListFragment.kt @@ -62,10 +62,7 @@ class TunnelListFragment : BaseFragment() { // Config text is valid, now create the tunnel… newInstance(configText).show(parentFragmentManager, null) } catch (e: Exception) { - when(e) { - is BadConfigException, is IOException -> onTunnelImportFinished(emptyList(), listOf(e)) - else -> throw e - } + onTunnelImportFinished(emptyList(), listOf(e)) } }