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:
parent
e166326ad9
commit
d5cb7e7ada
1 changed files with 4 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue