mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
NPE when trying to save non-C file in editor:
java.lang.NullPointerException at org.eclipse.cdt.internal.ui.editor.CEditor.editorSaved(CEditor.java:3776) at org.eclipse.ui.texteditor.AbstractTextEditor.performSave(AbstractTextEditor.java:5058)
This commit is contained in:
parent
53306d93e9
commit
d9caf9f42b
1 changed files with 7 additions and 4 deletions
|
@ -3773,10 +3773,13 @@ public class CEditor extends TextEditor implements ICEditor, ISelectionChangedLi
|
|||
@Override
|
||||
protected void editorSaved() {
|
||||
super.editorSaved();
|
||||
ITranslationUnit translationUnit = getInputCElement().getOriginalElement();
|
||||
if (translationUnit != null) {
|
||||
for (Object listener : fPostSaveListeners.getListeners()) {
|
||||
((IPostSaveListener) listener).saved(translationUnit, getProgressMonitor());
|
||||
IWorkingCopy inputCElement = getInputCElement();
|
||||
if (inputCElement != null) {
|
||||
ITranslationUnit translationUnit = inputCElement.getOriginalElement();
|
||||
if (translationUnit != null) {
|
||||
for (Object listener : fPostSaveListeners.getListeners()) {
|
||||
((IPostSaveListener) listener).saved(translationUnit, getProgressMonitor());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue