1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

fixed NPE when no editor is open.

This commit is contained in:
Warren Paul 2008-10-29 23:24:12 +00:00
parent 947fd5b342
commit 7056946b85

View file

@ -805,7 +805,11 @@ public class DOMAST extends ViewPart {
private void makeActions() { private void makeActions() {
loadActiveEditorAction = new Action() { loadActiveEditorAction = new Action() {
public void run() { public void run() {
openDOMASTView(getActiveEditor()); // first make sure there is an open editor
IEditorPart editor = getActiveEditor();
if (editor != null) {
openDOMASTView(getActiveEditor());
}
} }
}; };
loadActiveEditorAction.setText(LOAD_ACTIVE_EDITOR); loadActiveEditorAction.setText(LOAD_ACTIVE_EDITOR);