mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
Fixed NPE (PY-22827)
This commit is contained in:
+6
-4
@@ -252,15 +252,17 @@ public class PyActiveSdkConfigurable implements UnnamedConfigurable {
|
||||
Sdk selectedSdk = getSelectedSdk();
|
||||
if (selectedSdk instanceof PyDetectedSdk) {
|
||||
final String sdkName = selectedSdk.getName();
|
||||
VirtualFile sdkHome = ApplicationManager.getApplication().runWriteAction(new Computable<VirtualFile>() {
|
||||
final VirtualFile sdkHome = ApplicationManager.getApplication().runWriteAction(new Computable<VirtualFile>() {
|
||||
@Override
|
||||
public VirtualFile compute() {
|
||||
return LocalFileSystem.getInstance().refreshAndFindFileByPath(sdkName);
|
||||
}
|
||||
});
|
||||
selectedSdk = SdkConfigurationUtil.createAndAddSDK(sdkHome.getPath(), PythonSdkType.getInstance());
|
||||
if (selectedSdk != null) {
|
||||
myProjectSdksModel.addSdk(selectedSdk);
|
||||
if (sdkHome != null) {
|
||||
selectedSdk = SdkConfigurationUtil.createAndAddSDK(sdkHome.getPath(), PythonSdkType.getInstance());
|
||||
if (selectedSdk != null) {
|
||||
myProjectSdksModel.addSdk(selectedSdk);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (myInitialSdkSet.contains(selectedSdk) && selectedSdk != null) {
|
||||
|
||||
Reference in New Issue
Block a user