diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-09-24 00:28:43 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-09-24 14:12:40 +0200 |
commit | 4bf34c49b797dd14c59184381b2d572d08a27fa4 (patch) | |
tree | ef4d012f3bfecb0fc0088fcd7e4a4c61ed4c8063 /ui/src/main/java/com | |
parent | 05511d49007a54e47251130300b662bf411542b6 (diff) |
ui: account for null data in callback
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'ui/src/main/java/com')
-rw-r--r-- | ui/src/main/java/com/wireguard/android/fragment/TunnelListFragment.kt | 1 |
1 files changed, 1 insertions, 0 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 a2eacd0b..9c9d0ecd 100644 --- a/ui/src/main/java/com/wireguard/android/fragment/TunnelListFragment.kt +++ b/ui/src/main/java/com/wireguard/android/fragment/TunnelListFragment.kt @@ -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) } } |