From 2c1df5f875d479e5e23603d29308e451ac55a685 Mon Sep 17 00:00:00 2001 From: mhmdanas <6daf084a-8eaf-40fb-86c7-8500077c3b69@anonaddy.me> Date: Fri, 30 Apr 2021 01:02:46 +0300 Subject: [PATCH] Actually fix the parentFile warning --- .../newpipe/local/subscription/SubscriptionFragment.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionFragment.kt b/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionFragment.kt index 16bdb6a13..d3f80e214 100644 --- a/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionFragment.kt +++ b/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionFragment.kt @@ -207,8 +207,9 @@ class SubscriptionFragment : BaseStateFragment() { super.onActivityResult(requestCode, resultCode, data) if (data != null && data.data != null && resultCode == Activity.RESULT_OK) { if (requestCode == REQUEST_EXPORT_CODE) { - val exportFile = Utils.getFileForUri(data.data!!)!! - if (!exportFile.parentFile.canWrite() || !exportFile.parentFile.canRead()) { + val exportFile = Utils.getFileForUri(data.data!!) + val parentFile = exportFile.parentFile!! + if (!parentFile.canWrite() || !parentFile.canRead()) { Toast.makeText(activity, R.string.invalid_directory, Toast.LENGTH_SHORT).show() } else { activity.startService(