mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
fix(DiskUtil): Fixed NPE crashes trying to get directory size
This commit is contained in:
parent
bf1f258455
commit
b26b526b1e
2 changed files with 3 additions and 1 deletions
|
@ -15,12 +15,14 @@
|
||||||
|
|
||||||
## Changes
|
## Changes
|
||||||
- Enable 'Split Tall Images' by default (@Smol-Ame)
|
- Enable 'Split Tall Images' by default (@Smol-Ame)
|
||||||
|
- Minor visual adjustments
|
||||||
|
|
||||||
## Fixes
|
## Fixes
|
||||||
- Fixed only few DoH provider is actually being used (Cloudflare, Google, AdGuard, and Quad9)
|
- Fixed only few DoH provider is actually being used (Cloudflare, Google, AdGuard, and Quad9)
|
||||||
- Fixed "Group by Ungrouped" showing duplicate entries
|
- Fixed "Group by Ungrouped" showing duplicate entries
|
||||||
- Fixed reader sometimes won't load images
|
- Fixed reader sometimes won't load images
|
||||||
- Handle some uncaught crashes
|
- Handle some uncaught crashes
|
||||||
|
- Fixed potential NPE crashes
|
||||||
|
|
||||||
## Other
|
## Other
|
||||||
- Simplify network helper code
|
- Simplify network helper code
|
||||||
|
|
|
@ -20,7 +20,7 @@ object DiskUtil {
|
||||||
fun getDirectorySize(f: File): Long {
|
fun getDirectorySize(f: File): Long {
|
||||||
var size: Long = 0
|
var size: Long = 0
|
||||||
if (f.isDirectory) {
|
if (f.isDirectory) {
|
||||||
for (file in f.listFiles()!!) {
|
for (file in f.listFiles().orEmpty()) {
|
||||||
size += getDirectorySize(file)
|
size += getDirectorySize(file)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue