Skip to content

Commit

Permalink
fix(java): handle null psiElement in resolveVariableValue
Browse files Browse the repository at this point in the history
Updated JavaPsiContextVariableProvider to handle null psiElement in resolveVariableValue method.
  • Loading branch information
phodal committed Jun 16, 2024
1 parent 418b8f5 commit ba34428
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import com.phodal.shirecore.provider.PsiContextVariableProvider
import com.phodal.shirelang.java.toolchain.getContainingClass

class JavaPsiContextVariableProvider : PsiContextVariableProvider {
override fun resolveVariableValue(psiElement: PsiElement, variable: PsiVariable): String {
val project = psiElement.project
override fun resolveVariableValue(psiElement: PsiElement?, variable: PsiVariable): String {
val project = psiElement?.project ?: return ""
if (psiElement.language.id != "JAVA") {
return ""
}
Expand Down

0 comments on commit ba34428

Please sign in to comment.