KT-3290 File.recurse NPE

#KT-3290 fixed
This commit is contained in:
Evgeny Gerashchenko
2013-03-01 23:28:09 +04:00
parent bfd80e7855
commit 0e85fdd2cf
2 changed files with 28 additions and 2 deletions
+3 -2
View File
@@ -12,8 +12,9 @@ import java.net.URL
*/
public fun File.recurse(block: (File) -> Unit): Unit {
block(this)
if (this.isDirectory()) {
for (child in this.listFiles()!!) {
val children = this.listFiles()
if (children != null) {
for (child in children) {
child.recurse(block)
}
}