Can't get file when event is invalid (EA-77748)

This commit is contained in:
Nikolay Krasko
2016-01-28 19:34:20 +03:00
parent 7c84225cc4
commit 63a50ca3a9
@@ -66,6 +66,7 @@ class LibraryModificationTracker(project: Project) : SimpleModificationTracker()
private inline fun processBulk(events: List<VFileEvent>, check: (VirtualFile) -> Boolean) { private inline fun processBulk(events: List<VFileEvent>, check: (VirtualFile) -> Boolean) {
events.forEach { event -> events.forEach { event ->
if (event.isValid) {
val file = event.file val file = event.file
if (file != null && check(file)) { if (file != null && check(file)) {
incModificationCount() incModificationCount()
@@ -73,6 +74,7 @@ class LibraryModificationTracker(project: Project) : SimpleModificationTracker()
} }
} }
} }
}
// if library points to a jar, the jar does not pass isInLibraryClasses check, so we have to perform additional check for this case // if library points to a jar, the jar does not pass isInLibraryClasses check, so we have to perform additional check for this case
private fun isLibraryArchiveRoot(virtualFile: VirtualFile): Boolean { private fun isLibraryArchiveRoot(virtualFile: VirtualFile): Boolean {