[workspace model] don't fire rootsChanged event for changes in global libraries if project isn't opened yet (IDEA-250455)

If a global library table is initialized during loading of a project, it doesn't make sense to fire rootsChanged events, and this may lead to exception if loading is performed on a background thread.

GitOrigin-RevId: f659ec8bee3935ab453b9d2efd1eaade72514965
This commit is contained in:
Nikolay Chashnikov
2020-09-14 20:30:30 +00:00
committed by intellij-monorepo-bot
parent 333d5cca77
commit 1cdc186b70
@@ -135,7 +135,9 @@ class ProjectRootManagerBridge(project: Project) : ProjectRootManagerComponent(p
}
private fun fireRootsChanged() {
makeRootsChange(EmptyRunnable.INSTANCE, false, true)
if (myProject.isOpen) {
makeRootsChange(EmptyRunnable.INSTANCE, false, true)
}
}
// Listener for global libraries linked to module