1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-09 18:56:02 +02:00

Check if the Resource is valid.

This commit is contained in:
Alain Magloire 2003-08-28 19:20:05 +00:00
parent e166326ad9
commit d5cb7e7ada

View file

@ -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();