mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[fleet] Python SDK library might be created before listener invocation
GitOrigin-RevId: d1ff30bb2f6c3d2764ca7cc0c22e34af2b4fd6a6
This commit is contained in:
committed by
intellij-monorepo-bot
parent
010a0b5a4d
commit
61550843c9
@@ -19,7 +19,17 @@ public class PythonSdkTableListener implements ProjectJdkTable.Listener {
|
||||
public void jdkAdded(@NotNull final Sdk sdk) {
|
||||
if (sdk.getSdkType() instanceof PythonSdkType) {
|
||||
ApplicationManager.getApplication().invokeLater(() -> ApplicationManager.getApplication().runWriteAction(() -> {
|
||||
addLibrary(sdk);
|
||||
final ModifiableModelsProvider provider = ModifiableModelsProvider.getInstance();
|
||||
final LibraryTable.ModifiableModel libraryTableModifiableModel = provider.getLibraryTableModifiableModel();
|
||||
Library library = libraryTableModifiableModel.getLibraryByName(PythonFacetUtil.getFacetLibraryName(sdk.getName()));
|
||||
provider.disposeLibraryTableModifiableModel(libraryTableModifiableModel);
|
||||
if (library == null) {
|
||||
addLibrary(sdk);
|
||||
}
|
||||
else {
|
||||
// Library might already be created before listener invocation, e.g. by PythonFacetUtil.updateLibrary
|
||||
updateLibrary(sdk);
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user