From d5cb7e7ada8f36818f2c33aa8c3d7b64f09de94d Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Thu, 28 Aug 2003 19:20:05 +0000 Subject: [PATCH] Check if the Resource is valid. --- .../org/eclipse/cdt/internal/core/model/TranslationUnit.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java index 9238c637c6d..9721592447d 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java @@ -334,7 +334,10 @@ public class TranslationUnit extends Openable implements ITranslationUnit { if (isWorkingCopy()) { ITranslationUnit original = (ITranslationUnit) ((IWorkingCopy)this).getOriginalElement(); // might be IResource.NULL_STAMP if original does not exist - unitInfo.fTimestamp = ((IFile) original.getResource()).getModificationStamp(); + IResource r = original.getResource(); + if (r != null && r instanceof IFile) { + unitInfo.fTimestamp = ((IFile) r).getModificationStamp(); + } } return unitInfo.isStructureKnown();