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:
parent
c03efa8220
commit
f6d8cec74d
2 changed files with 8 additions and 2 deletions
|
@ -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.
|
||||
|
|
|
@ -94,8 +94,10 @@ public class CDocumentProvider extends TextFileDocumentProvider {
|
|||
if (element instanceof IFileEditorInput) {
|
||||
IFileEditorInput input = (IFileEditorInput)element;
|
||||
original = createTranslationUnit(input.getFile());
|
||||
IBufferFactory factory = CUIPlugin.getDefault().getBufferFactory();
|
||||
copy = original.getSharedWorkingCopy(getProgressMonitor(), factory);
|
||||
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());
|
||||
|
|
Loading…
Add table
Reference in a new issue