ui: account for null data in callback
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
05511d4900
commit
4bf34c49b7
@ -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) }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user