[plugins] PluginEnabler implementations registered
[idea/community.git] / platform / platform-impl / src / com / intellij / ide / plugins / newui / ProjectDependentPluginEnabledState.kt
index d35c0f241a74d8a96f4fc84cc4c527ab40e1b25c..6bc8ac5cddfb15064dcb4febfb83677983aede49 100644 (file)
@@ -22,15 +22,16 @@ class ProjectDependentPluginEnabledState(
       emptyList()
     }
     else {
-      val pluginEnabler = DynamicPluginEnabler.getInstance()
-      ProjectManager.getInstance()
-        .openProjects
-        .asSequence()
-        .filterNot { it == project }
-        .map { pluginEnabler.getPluginTracker(it) }
-        .filter { !PluginEnabler.HEADLESS.isDisabled(pluginId) || it.isEnabled(pluginId) }
-        .map { it.projectName }
-        .toList()
+      (PluginEnabler.getInstance() as? DynamicPluginEnabler)?.let { pluginEnabler ->
+        ProjectManager.getInstance()
+          .openProjects
+          .asSequence()
+          .filterNot { it == project }
+          .map { pluginEnabler.getPluginTracker(it) }
+          .filter { !pluginEnabler.isDisabled(pluginId) || it.isEnabled(pluginId) }
+          .map { it.projectName }
+          .toList()
+      } ?: emptyList()
     }
   }