ProgressIndicator (@NotNull Task.Backgroundable task) { if (ApplicationManager.getApplication().isHeadlessEnvironment()) { return shouldKeepTasksAsynchronousInHeadlessMode() ? new ProgressIndicatorBase() : new EmptyProgressIndicator(); } Project project = task.getProject(); return project != null && project.isDisposed() ? new EmptyProgressIndicator() : new BackgroundableProcessIndicator(task); }