Skip to content

Commit 1c2d2d3

Browse files
committed
avoid "unnecessary safe call" warning
1 parent 6529074 commit 1c2d2d3

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/main/kotlin/io/openapiprocessor/intellij/OpenApiPathGist.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ private fun findKeys(file: PsiFile): List<YamlKey> {
4444
if (file !is YAMLFile)
4545
return emptyList()
4646

47-
// using save navigation because otherwise it crashes if called from tests
48-
log.debug("indexing file: {}", file?.virtualFile?.path)
47+
// this is null if called from MappingAnnotationLineMarkerSpec
48+
if (file.virtualFile != null) {
49+
log.debug("indexing file: {}", file.virtualFile.path)
50+
}
4951

5052
val keys = mutableListOf<YamlKey>()
5153

0 commit comments

Comments
 (0)