Skip to content

Commit 4c864d1

Browse files
committed
refactor: do not throw error if the project root directory is not found
1 parent 8ab1c6b commit 4c864d1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/kotlin/com/github/lppedd/cc/configuration/CCTokensService.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ internal class CCTokensService(private val project: Project) {
191191
}
192192

193193
private fun findFileUnderProjectRoot(fileName: String, createIfNotExists: Boolean = false): VirtualFile? {
194-
val rootDir = project.findRootDir() ?: error("Expected a project root directory")
194+
val rootDir = project.findRootDir() ?: return null // Avoid throwing as otherwise buildSearchableOptions fails
195195
var file = rootDir.findChild(fileName)
196196

197197
if (file?.isValid == true) {

0 commit comments

Comments
 (0)