fix(DiskUtil): Fixed NPE crashes trying to get directory size

This commit is contained in:
Ahmad Ansori Palembani 2024-09-04 07:24:24 +07:00
parent bf1f258455
commit b26b526b1e
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
2 changed files with 3 additions and 1 deletions

View file

@ -15,12 +15,14 @@
## Changes
- Enable 'Split Tall Images' by default (@Smol-Ame)
- Minor visual adjustments
## Fixes
- Fixed only few DoH provider is actually being used (Cloudflare, Google, AdGuard, and Quad9)
- Fixed "Group by Ungrouped" showing duplicate entries
- Fixed reader sometimes won't load images
- Handle some uncaught crashes
- Fixed potential NPE crashes
## Other
- Simplify network helper code

View file

@ -20,7 +20,7 @@ object DiskUtil {
fun getDirectorySize(f: File): Long {
var size: Long = 0
if (f.isDirectory) {
for (file in f.listFiles()!!) {
for (file in f.listFiles().orEmpty()) {
size += getDirectorySize(file)
}
} else {