Skip to content

Commit

Permalink
fix null exception (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklx authored Jan 24, 2024
1 parent 7dd5a8e commit 60a68b3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/kotlin/com/emberjs/utils/PsiElementExtensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ import com.intellij.openapi.vfs.VirtualFile
import com.intellij.patterns.PsiElementPattern
import com.intellij.psi.PsiElement
import com.intellij.psi.util.PsiFilter
import java.util.*


val PsiElement.originalVirtualFile: VirtualFile?
get() = containingFile.originalFile.virtualFile
get() = containingFile?.originalFile?.virtualFile

val PsiElement.module: Module?
get() = originalVirtualFile?.let { findModuleForFile(it, project) }
Expand Down

0 comments on commit 60a68b3

Please sign in to comment.