Skip to content

Commit ef9d0ef

Browse files
authored
Merge pull request #122 from domaframework/fix/string-index-outofbounds-exception
Fix: StringIndexOutOfBoundsException: Range In FileTypeCheck
2 parents 434a07a + 13528f8 commit ef9d0ef

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/kotlin/org/domaframework/doma/intellij/common/FileTypeCheck.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ fun searchDaoFile(
7979
if (projectRootPath.endsWith(SRC_MAIN_PATH)) {
8080
return contentRoot.findFileByRelativePath(relativeDaoFilePath)
8181
}
82+
83+
if (projectRootPath.length > originFilePath.length) {
84+
return null
85+
}
86+
8287
val subProject =
8388
originFilePath.substring(projectRootPath.length, originFilePath.indexOf(SRC_MAIN_PATH))
8489
return contentRoot

0 commit comments

Comments
 (0)