Skip to content

Commit

Permalink
Fix since getExternalFilesDirs may return null
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedre committed Dec 31, 2020
1 parent 4f09616 commit bcd411d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ class QuranDataActivity : Activity(), SimpleDownloadListener, OnRequestPermissio
val fallbackFile = filesDir
val usesInternalDir = path != null && path == fallbackFile.absolutePath
val usesExternalFileDir = path != null &&
ContextCompat.getExternalFilesDirs(this, null).any {
it.absolutePath == path
ContextCompat.getExternalFilesDirs(this, null).any { file: File? ->
file != null && file.absolutePath == path
}

if (path == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import com.quran.data.source.PageProvider
import com.quran.data.upgrade.LocalDataUpgrade
import com.quran.labs.androidquran.QuranDataActivity
import com.quran.labs.androidquran.data.Constants
import com.quran.labs.androidquran.data.QuranFileConstants
import com.quran.labs.androidquran.presenter.Presenter
import com.quran.labs.androidquran.util.QuranFileUtils
import com.quran.labs.androidquran.util.QuranScreenInfo
Expand Down

0 comments on commit bcd411d

Please sign in to comment.