Skip to content

Commit fba1726

Browse files
authored
Fix NPE calling isInTestSourceContent (#2785)
1 parent 48edf61 commit fba1726

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "bugfix",
3+
"description" : "Fix NullPointerException calling isInTestSourceContent (#2752)"
4+
}

jetbrains-core/src/software/aws/toolkits/jetbrains/utils/PsiUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import com.intellij.psi.PsiElement
99

1010
fun PsiElement.isTestOrInjectedText(): Boolean {
1111
val project = this.project
12-
val virtualFile = this.containingFile.virtualFile
12+
val virtualFile = this.containingFile.virtualFile ?: return false
1313
if (virtualFile is VirtualFileWindow) {
1414
return true
1515
}

0 commit comments

Comments
 (0)