Fix NPE on initialization of Python plugin in CLion (CPP-7743)
authorDmitry Trofimov <dmitry.trofimov@jetbrains.com>
Tue, 21 Feb 2017 19:33:13 +0000 (20:33 +0100)
committerDmitry Trofimov <dmitry.trofimov@jetbrains.com>
Tue, 21 Feb 2017 19:33:13 +0000 (20:33 +0100)
python/pluginMinor/com/jetbrains/python/facet/PythonFacetType.java

index 51f93a4877bae141ae0eb332f98018555ae72bcc..223d7e84869db641528a219fdea0139cdccd0059 100644 (file)
@@ -93,7 +93,9 @@ public class PythonFacetType extends FacetType<PythonFacet, PythonFacetType.Pyth
       String sdkName = element.getAttributeValue(SDK_NAME);
       mySdk = StringUtil.isEmpty(sdkName) ? null : ProjectJdkTable.getInstance().findJdk(sdkName, PythonSdkType.getInstance().getName());
 
-      ApplicationManager.getApplication().getMessageBus().syncPublisher(ProjectJdkTable.JDK_TABLE_TOPIC).jdkAdded(mySdk);
+      if (mySdk != null) {
+        ApplicationManager.getApplication().getMessageBus().syncPublisher(ProjectJdkTable.JDK_TABLE_TOPIC).jdkAdded(mySdk);
+      }
     }
 
     public void writeExternal(Element element) throws WriteExternalException {