Skip to content

Commit

Permalink
Merge pull request #3774 from Hannah-Sten/cache-exception
Browse files Browse the repository at this point in the history
Check if file is still valid after retrieving from cache
  • Loading branch information
PHPirates authored Nov 27, 2024
2 parents f62840f + e5f0486 commit 5c17d7b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Added

### Fixed
* Fix exception #3771 when a file referenced from cache is deleted
* Fix basic case of false positive of duplicate label inspection when user defined \if commands are used
* Fix a parse error when using \else with a user defined \if-command

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ class ReferencedFileSetCache {
}
}
}
cache[file.virtualFile]?.mapNotNull { it.element }?.toSet() ?: setOf(file)
// Make sure to check if file is still valid after retrieving from cache (it may have been deleted)
cache[file.virtualFile]?.mapNotNull { it.element }?.filter { it.isValid }?.toSet() ?: setOf(file)
}
else {
setOf(file)
Expand Down

0 comments on commit 5c17d7b

Please sign in to comment.