[java] Check if editor belongs to project before removing cache

#IJPL-10786

GitOrigin-RevId: d3da33ac2438ff9a74be9c1f4fc1029adc9da25b
This commit is contained in:
Bart van Helvert
2025-08-24 16:21:07 +00:00
committed by intellij-monorepo-bot
parent 5eda5888a3
commit 498848764c
@@ -188,6 +188,7 @@ private class ProjectProblemFileSelectionListenerStartupActivity : ProjectActivi
// Remove fragments from the cache once the editor gets released
EditorFactory.getInstance().addEditorFactoryListener(object : EditorFactoryListener {
override fun editorReleased(event: EditorFactoryEvent) {
if (event.editor.project != project) return
val virtualFile = FileDocumentManager.getInstance().getFile(event.editor.document) ?: return
ReadAction.nonBlocking<Any> {
if (!virtualFile.isValid) return@nonBlocking null