We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f9de58 commit 01f9a0cCopy full SHA for 01f9a0c
src/main/kotlin/com/github/oldmegit/goframehelper/gf/Gf.kt
@@ -36,9 +36,14 @@ object Gf {
36
private fun getRelativePath(project: Project, virtualFile: VirtualFile): String {
37
val basePathCls = Paths.get(project.basePath.toString())
38
val filePathCls = Paths.get(virtualFile.path)
39
- var absolute = basePathCls.relativize(filePathCls).toString()
40
- if (File.separator == "\\") {
41
- absolute = absolute.replace("\\", "/")
+ var absolute: String
+ try {
+ absolute = basePathCls.relativize(filePathCls).toString()
42
+ if (File.separator == "\\") {
43
+ absolute = absolute.replace("\\", "/")
44
+ }
45
+ } catch (_: Exception) {
46
+ absolute = ""
47
}
48
return absolute
49
0 commit comments