Skip to content

Commit

Permalink
Improved the getFullFilePathFromFilePath method to not return the f…
Browse files Browse the repository at this point in the history
…ilePath for null fileNames.
  • Loading branch information
MohitMaliDeveloper authored and kelson42 committed Oct 6, 2024
1 parent fc915a0 commit b68bcc1
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,12 @@ object FileUtils {
filePath: String?
): String? {
var actualFilePath: String? = null
getStorageVolumesList(context).forEach { volume ->
val file = File("$volume/$filePath")
if (file.isFileExist()) {
actualFilePath = file.path
if (filePath?.isNotEmpty() == true) {
getStorageVolumesList(context).forEach { volume ->
val file = File("$volume/$filePath")
if (file.isFileExist()) {
actualFilePath = file.path

Check warning on line 192 in core/src/main/java/org/kiwix/kiwixmobile/core/utils/files/FileUtils.kt

View check run for this annotation

Codecov / codecov/patch

core/src/main/java/org/kiwix/kiwixmobile/core/utils/files/FileUtils.kt#L192

Added line #L192 was not covered by tests
}
}
}
return actualFilePath
Expand Down

0 comments on commit b68bcc1

Please sign in to comment.