ui: account for null data in callback

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2020-09-24 00:28:43 +02:00
parent 05511d4900
commit 4bf34c49b7

View File

@ -47,6 +47,7 @@ class TunnelListFragment : BaseFragment() {
private var binding: TunnelListFragmentBinding? = null
private val tunnelFileImportResultLauncher = registerForActivityResult(ActivityResultContracts.GetContent()) { data ->
lifecycleScope.launch {
if (data == null) return@launch
val contentResolver = activity?.contentResolver ?: return@launch
TunnelImporter.importTunnel(contentResolver, data) { showSnackbar(it) }
}