aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui/src/main/java/com/wireguard
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/java/com/wireguard
parentui: cleanup code after churn (diff)
downloadwireguard-android-4bf34c49b797dd14c59184381b2d572d08a27fa4.tar.xz
wireguard-android-4bf34c49b797dd14c59184381b2d572d08a27fa4.zip
ui: account for null data in callback
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'ui/src/main/java/com/wireguard')
-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 a2eacd0..9c9d0ec 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) }
}