Commit 5592c10
committed
fix: guard isTestoFile against invalid VirtualFile
TestoIconProvider could trigger an "Outdated stub in index" exception
when invoked on a stale PsiFile whose underlying physical file no
longer existed (e.g. a deleted vendor/autoload.php still cached in the
stub index). isTestoFile() walked the AST via PsiTreeUtil before any
validity check, forcing AST load and crashing on the stub mismatch.
Short-circuit isTestoFile() if the file is not a PhpFile, has no
VirtualFile, or its VirtualFile is no longer valid - avoiding any PSI
traversal in those cases.1 parent b320de1 commit 5592c10
2 files changed
Lines changed: 28 additions & 3 deletions
File tree
- src
- main/kotlin/com/github/xepozz/testo
- test/kotlin/com/github/xepozz/testo
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
48 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
49 | 55 | | |
50 | 56 | | |
51 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
155 | 156 | | |
156 | 157 | | |
157 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
158 | 177 | | |
159 | 178 | | |
160 | 179 | | |
| |||
0 commit comments