Skip to content

Commit a2b47ab

Browse files
committed
fix(DiskUtil): Fixed NPE crashes trying to get directory size
1 parent 2debbc0 commit a2b47ab

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
## Other ?? Technical stuff, what happened behind the scene
1111
-->
1212
## Fixes
13-
- Fixed NPE crash on tablets
13+
- Fixed more NPE crashes

app/src/main/java/eu/kanade/tachiyomi/util/storage/DiskUtil.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ object DiskUtil {
2020
fun getDirectorySize(f: File): Long {
2121
var size: Long = 0
2222
if (f.isDirectory) {
23-
for (file in f.listFiles()!!) {
23+
for (file in f.listFiles().orEmpty()) {
2424
size += getDirectorySize(file)
2525
}
2626
} else {

0 commit comments

Comments
 (0)