TunnelListFragment: catch all parsing exceptions
Otherwise we crash if weird things happen. Reported-by: Luis Ressel <aranea@aixah.de> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
240e049e46
commit
87c9efce4a
@ -62,10 +62,7 @@ class TunnelListFragment : BaseFragment() {
|
|||||||
// Config text is valid, now create the tunnel…
|
// Config text is valid, now create the tunnel…
|
||||||
newInstance(configText).show(parentFragmentManager, null)
|
newInstance(configText).show(parentFragmentManager, null)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
when(e) {
|
onTunnelImportFinished(emptyList(), listOf<Throwable>(e))
|
||||||
is BadConfigException, is IOException -> onTunnelImportFinished(emptyList(), listOf<Throwable>(e))
|
|
||||||
else -> throw e
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user