mirror of https://github.com/sbt/sbt.git
listFiles can return null
This commit is contained in:
parent
363e8687e2
commit
c3ed92362a
|
|
@ -22,7 +22,7 @@ object CacheFetchTests extends TestSuite {
|
|||
def cleanTmpDir() = {
|
||||
def delete(f: File): Boolean =
|
||||
if (f.isDirectory) {
|
||||
val removedContent = f.listFiles().map(delete).forall(x => x)
|
||||
val removedContent = Option(f.listFiles()).toSeq.flatten.map(delete).forall(x => x)
|
||||
val removedDir = f.delete()
|
||||
|
||||
removedContent && removedDir
|
||||
|
|
|
|||
Loading…
Reference in New Issue