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

Fix NPE in CDocumentProvider

This commit is contained in:
Alain Magloire 2004-04-20 18:37:22 +00:00
parent c03efa8220
commit f6d8cec74d
2 changed files with 8 additions and 2 deletions

View file

@ -1,3 +1,7 @@
2004-04-20 Alain Magloire
Fix NPE in CDocumentProvider
* src/org/eclipse/cdt/internalu/ui/editor/CDocumentProvider.java
2004-04-20 David Inglis
More of the model throws CModeLException.

View file

@ -94,8 +94,10 @@ public class CDocumentProvider extends TextFileDocumentProvider {
if (element instanceof IFileEditorInput) {
IFileEditorInput input = (IFileEditorInput)element;
original = createTranslationUnit(input.getFile());
if (original != null) {
IBufferFactory factory = CUIPlugin.getDefault().getBufferFactory();
copy = original.getSharedWorkingCopy(getProgressMonitor(), factory);
}
} else if (element instanceof ITranslationUnitEditorInput) {
ITranslationUnitEditorInput input = (ITranslationUnitEditorInput)element;
copy = new CFileElementWorkingCopy(input.getTranslationUnit());