summaryrefslogtreecommitdiffhomepage
path: root/ui/src/main
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-09-24 00:28:43 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2020-09-24 14:12:40 +0200
commit4bf34c49b797dd14c59184381b2d572d08a27fa4 (patch)
treeef4d012f3bfecb0fc0088fcd7e4a4c61ed4c8063 /ui/src/main
parent05511d49007a54e47251130300b662bf411542b6 (diff)
ui: account for null data in callback
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'ui/src/main')
-rw-r--r--ui/src/main/java/com/wireguard/android/fragment/TunnelListFragment.kt1
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) }
}