mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 02:34:39 +00:00
fix(DiskUtil): Fixed NPE crashes trying to get directory size
This commit is contained in:
parent
2debbc0a10
commit
a2b47ab244
2 changed files with 2 additions and 2 deletions
|
@ -10,4 +10,4 @@
|
|||
## Other ?? Technical stuff, what happened behind the scene
|
||||
-->
|
||||
## Fixes
|
||||
- Fixed NPE crash on tablets
|
||||
- Fixed more NPE crashes
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue