@@ -43,7 +43,7 @@ class ClassPathFactory {
43
43
yield newClassPath(entry)
44
44
45
45
def classesInExpandedPath (path : String )(using Context ): IndexedSeq [ClassPath ] =
46
- classesInPathImpl(path, expand = true ).toIndexedSeq
46
+ if path.trim.isEmpty then IndexedSeq .empty[ ClassPath ] else classesInPathImpl(path, expand = true ).toIndexedSeq
47
47
48
48
def classesInPath (path : String )(using Context ): List [ClassPath ] = classesInPathImpl(path, expand = false )
49
49
@@ -69,8 +69,10 @@ class ClassPathFactory {
69
69
a <- ClassPath .expandManifestPath(file.absolutePath)
70
70
path = java.nio.file.Paths .get(a.toURI()).nn
71
71
if Files .exists(path)
72
+ entry = AbstractFile .getFile(path)
73
+ if Option (entry).nonEmpty
72
74
yield
73
- newClassPath(AbstractFile .getFile(path) )
75
+ newClassPath(entry )
74
76
else
75
77
Seq .empty
76
78
@@ -79,9 +81,10 @@ class ClassPathFactory {
79
81
end classesInPathImpl
80
82
81
83
private def createSourcePath (file : AbstractFile )(using Context ): ClassPath =
82
- if (file.isJarOrZip)
84
+ val nonNull = Option (file).nonEmpty
85
+ if (nonNull && file.isJarOrZip)
83
86
ZipAndJarSourcePathFactory .create(file)
84
- else if (file.isDirectory)
87
+ else if (nonNull && file.isDirectory)
85
88
new DirectorySourcePath (file.file)
86
89
else
87
90
sys.error(s " Unsupported sourcepath element: $file" )
0 commit comments