From 8df778a515ce153499524db2a4ed6be94d83fa8d Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Mon, 14 Dec 2020 13:14:12 +0100 Subject: [PATCH] fixed crash when importing modules from the same directory as the main program --- compiler/src/prog8/parser/ModuleParsing.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/prog8/parser/ModuleParsing.kt b/compiler/src/prog8/parser/ModuleParsing.kt index dbf845fc0..364cc2aa6 100644 --- a/compiler/src/prog8/parser/ModuleParsing.kt +++ b/compiler/src/prog8/parser/ModuleParsing.kt @@ -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() else mutableListOf(source.parent) + val locations = if(source.toString().isEmpty()) mutableListOf() else mutableListOf(source.parent ?: Path.of(".")) val propPath = System.getProperty("prog8.libdir") if(propPath!=null)