fixed crash when importing modules from the same directory as the main program

This commit is contained in:
Irmen de Jong 2020-12-14 13:14:12 +01:00
parent 5134ea76bf
commit 8df778a515

View File

@ -102,7 +102,7 @@ internal class ModuleImporter {
private fun discoverImportedModuleFile(name: String, source: Path, position: Position?): Path {
val fileName = "$name.p8"
val locations = if(source.toString().isEmpty()) mutableListOf<Path>() else mutableListOf(source.parent)
val locations = if(source.toString().isEmpty()) mutableListOf<Path>() else mutableListOf(source.parent ?: Path.of("."))
val propPath = System.getProperty("prog8.libdir")
if(propPath!=null)