From c3ed92362a2a8473ada44980c6287e273add818f Mon Sep 17 00:00:00 2001 From: Alexandre Archambault Date: Fri, 6 May 2016 13:54:23 +0200 Subject: [PATCH] listFiles can return null --- tests/jvm/src/test/scala/coursier/test/CacheFetchTests.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/jvm/src/test/scala/coursier/test/CacheFetchTests.scala b/tests/jvm/src/test/scala/coursier/test/CacheFetchTests.scala index 5585a7805..ab2cdc73e 100644 --- a/tests/jvm/src/test/scala/coursier/test/CacheFetchTests.scala +++ b/tests/jvm/src/test/scala/coursier/test/CacheFetchTests.scala @@ -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