diff --git a/app/build.gradle.kts b/app/build.gradle.kts index c9a5dae..b47383b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -17,7 +17,7 @@ android { val versionMajor = 2 val versionMinor = 3 - val versionPatch = 4 + val versionPatch = 5 val versionBuild = 0 defaultConfig { diff --git a/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/main/MainViewModel.kt b/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/main/MainViewModel.kt index e1c151f..6897cff 100644 --- a/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/main/MainViewModel.kt +++ b/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/main/MainViewModel.kt @@ -144,7 +144,12 @@ class MainViewModel @Inject constructor(private val application : Application, @SuppressLint("Range") private fun getFileName(context: Context, uri: Uri): String { if (uri.scheme == "content") { - val cursor = context.contentResolver.query(uri, null, null, null, null) + val cursor = try { + context.contentResolver.query(uri, null, null, null, null) + } catch (e : Exception) { + Timber.d("Exception getting config name") + null + } cursor ?: return defaultConfigName() cursor.use { if(cursor.moveToFirst()) {