Skip to content

Commit 2c1df5f

Browse files
committed
Actually fix the parentFile warning
1 parent e7ae215 commit 2c1df5f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionFragment.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,9 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() {
207207
super.onActivityResult(requestCode, resultCode, data)
208208
if (data != null && data.data != null && resultCode == Activity.RESULT_OK) {
209209
if (requestCode == REQUEST_EXPORT_CODE) {
210-
val exportFile = Utils.getFileForUri(data.data!!)!!
211-
if (!exportFile.parentFile.canWrite() || !exportFile.parentFile.canRead()) {
210+
val exportFile = Utils.getFileForUri(data.data!!)
211+
val parentFile = exportFile.parentFile!!
212+
if (!parentFile.canWrite() || !parentFile.canRead()) {
212213
Toast.makeText(activity, R.string.invalid_directory, Toast.LENGTH_SHORT).show()
213214
} else {
214215
activity.startService(

0 commit comments

Comments
 (0)