fix UOE from maven plugin in headless mode
authorMihail Muhin <mihail.muhin@jetbrains.com>
Fri, 23 Oct 2020 20:31:31 +0000 (23:31 +0300)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Sat, 24 Oct 2020 00:53:46 +0000 (00:53 +0000)
GitOrigin-RevId: 1baeed7986195c3ac666458ddc1bdb0949389eac

platform/lang-impl/src/com/intellij/build/BuildView.java

index 804d902834a818cb5b2b8371dde6955086af5b9a..cb4618d40884d4dd3479a43126d076fbdabdb9e4 100644 (file)
@@ -111,6 +111,8 @@ public class BuildView extends CompositeView<ExecutionConsole>
   }
 
   private void onStartBuild(@NotNull Object buildId, @NotNull StartBuildEvent startBuildEvent) {
+    if (ApplicationManager.getApplication().isHeadlessEnvironment()) return;
+
     if (startBuildEvent instanceof StartBuildEventImpl) {
       myViewSettingsProvider = ((StartBuildEventImpl)startBuildEvent).getBuildViewSettingsProvider();
     }
@@ -131,7 +133,7 @@ public class BuildView extends CompositeView<ExecutionConsole>
     }
     ExecutionConsole executionConsole = myExecutionConsole;
     if (executionConsole != null) {
-      executionConsole.getComponent(); //create editor to be able to add console editor actions
+      executionConsole. getComponent(); //create editor to be able to add console editor actions
       if (myViewSettingsProvider.isExecutionViewHidden()) {
         addViewAndShowIfNeeded(executionConsole, CONSOLE_VIEW_NAME, myViewManager.isConsoleEnabledByDefault());
       }