mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix for 159863 by Wieant, NPE in full indexer.
This commit is contained in:
parent
fd2c99b278
commit
2b21a7091f
1 changed files with 12 additions and 8 deletions
|
@ -17,6 +17,7 @@ import org.eclipse.cdt.core.model.ICElementVisitor;
|
|||
import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
|
@ -74,14 +75,17 @@ public class PDOMFullReindex extends PDOMFullIndexerJob {
|
|||
ITranslationUnit tu = (ITranslationUnit)element;
|
||||
if (tu.isHeaderUnit()) {
|
||||
IFile rfile = (IFile)tu.getUnderlyingResource();
|
||||
String filename = rfile.getLocation().toOSString();
|
||||
if (pdom.getFile(filename) == null) {
|
||||
try {
|
||||
addTU(tu);
|
||||
} catch (InterruptedException e) {
|
||||
CCorePlugin.log(e);
|
||||
if (++errorCount > MAX_ERRORS)
|
||||
throw new CoreException(Status.CANCEL_STATUS);
|
||||
IPath fileLocation = rfile.getLocation();
|
||||
if ( fileLocation != null ) {
|
||||
String filename = fileLocation.toOSString();
|
||||
if (pdom.getFile(filename) == null) {
|
||||
try {
|
||||
addTU(tu);
|
||||
} catch (InterruptedException e) {
|
||||
CCorePlugin.log(e);
|
||||
if (++errorCount > MAX_ERRORS)
|
||||
throw new CoreException(Status.CANCEL_STATUS);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue