diff --git a/grease/src/main/kotlin/io/deepmedia/tools/grease/files.kt b/grease/src/main/kotlin/io/deepmedia/tools/grease/files.kt index 73b9241..2879515 100644 --- a/grease/src/main/kotlin/io/deepmedia/tools/grease/files.kt +++ b/grease/src/main/kotlin/io/deepmedia/tools/grease/files.kt @@ -43,7 +43,7 @@ val File.packageNames: Set if (file.name != "module-info.class") { val cleanedPath = file.path.removePrefix(this.path).removePrefix("/") cleanedPath - .substring(0 until cleanedPath.lastIndexOf('/')) - .replace('/', '.') + .substring(0 until cleanedPath.lastIndexOf('/').coerceAtLeast(0)) + .replace('/', '.').takeIf { it.isNotBlank() } } else null }.toSet() \ No newline at end of file