backgroundable process without project lead to lost key events (IDEA-95754)

== the status bar is chosen randomly; for welcome screen simple NPE workaround
(cherry picked from commit e17cc7f763866bb566619fc98d47909d9ef4aebe)
This commit is contained in:
anna
2012-11-29 11:53:07 +01:00
parent 9fa817953c
commit aeca2231a5
2 changed files with 5 additions and 3 deletions
@@ -66,7 +66,7 @@ public class BackgroundableProcessIndicator extends ProgressWindow {
}
public BackgroundableProcessIndicator(@Nullable final Project project, @NotNull TaskInfo info, @NotNull PerformInBackgroundOption option) {
super(info.isCancellable(), project != null && !project.isDefault(), project, info.getCancelText());
super(info.isCancellable(), true, project, info.getCancelText());
if (project != null) {
final ProjectManagerAdapter myListener = new ProjectManagerAdapter() {
public void projectClosing(Project closingProject) {
@@ -153,7 +153,9 @@ public class BackgroundableProcessIndicator extends ProgressWindow {
}
private void doBackground() {
myStatusBar.addProgress(this, myInfo);
if (myStatusBar != null) { //not welcome screen
myStatusBar.addProgress(this, myInfo);
}
}
public void dispose() {
@@ -109,7 +109,7 @@ public final class ExecutionHandler {
final boolean startInBackground = buildFile.isRunInBackground();
new Task.Backgroundable(null, AntBundle.message("ant.build.progress.dialog.title"), true) {
new Task.Backgroundable(buildFile.getProject(), AntBundle.message("ant.build.progress.dialog.title"), true) {
public boolean shouldStartInBackground() {
return startInBackground;