diff --git a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/libraries/LibraryTableBase.java b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/libraries/LibraryTableBase.java index eb4af934fac4..46b43ef33ea7 100644 --- a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/libraries/LibraryTableBase.java +++ b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/libraries/LibraryTableBase.java @@ -69,23 +69,18 @@ public abstract class LibraryTableBase implements PersistentStateComponent { - model.readExternal(element); - commit(model); - }); - } + if (myFirstLoad) { + myModel.readExternal(element); + } + else { + LibraryModel model = new LibraryModel(myModel); + WriteAction.run(() -> { + model.readExternal(element); + commit(model); + }); + } - myFirstLoad = false; - } - catch (InvalidDataException e) { - throw new RuntimeException(e); - } + myFirstLoad = false; } public long getStateModificationCount() {