mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
NPE in git status bar widget [max]
This commit is contained in:
@@ -38,6 +38,7 @@ public abstract class EditorBasedWidget extends FileEditorManagerAdapter impleme
|
||||
private Project myProject;
|
||||
|
||||
protected MessageBusConnection myConnection;
|
||||
private boolean myDisposed;
|
||||
|
||||
protected EditorBasedWidget(Project project) {
|
||||
myProject = project;
|
||||
@@ -106,6 +107,8 @@ public abstract class EditorBasedWidget extends FileEditorManagerAdapter impleme
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
myDisposed = true;
|
||||
|
||||
myStatusBar = null;
|
||||
if (myConnection != null) {
|
||||
myConnection.disconnect();
|
||||
@@ -113,4 +116,8 @@ public abstract class EditorBasedWidget extends FileEditorManagerAdapter impleme
|
||||
}
|
||||
myProject = null;
|
||||
}
|
||||
|
||||
protected final boolean isDisposed() {
|
||||
return myDisposed;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,6 +127,8 @@ public class GitCurrentBranchWidget extends EditorBasedWidget implements StatusB
|
||||
Task.Backgroundable task = new Task.Backgroundable(project, "") {
|
||||
@Override
|
||||
public void run(ProgressIndicator indicator) {
|
||||
if (isDisposed()) return;
|
||||
|
||||
String currentBranchName = null;
|
||||
if (file != null) {
|
||||
AbstractVcs vcs = myVcsManager.getVcsFor(file);
|
||||
|
||||
Reference in New Issue
Block a user