Skip to content

Commit

Permalink
fix: check for disposal (#625)
Browse files Browse the repository at this point in the history
  • Loading branch information
bastiandoetsch authored Oct 14, 2024
1 parent 9ede32e commit f5edb1d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/main/kotlin/io/snyk/plugin/SnykFile.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ data class SnykFile(val project: Project, val virtualFile: VirtualFile) {
val relativePath = runAsync { RelativePathHelper().getRelativePath(virtualFile, project) }

fun isInContent(): Boolean {
if (project.isDisposed) {
return false
}
return this.virtualFile.isInContent(project)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/snyk/common/SnykCachedResults.kt
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class SnykCachedResults(
snykFile: SnykFile,
issueList: List<ScanIssue>
) {
if (!snykFile.isInContent()) return
if (snykFile.project.isDisposed || !snykFile.isInContent()) return
when (product) {
LsProductConstants.OpenSource.value -> {
currentOSSResultsLS[snykFile] = issueList
Expand Down

0 comments on commit f5edb1d

Please sign in to comment.