1
0
Fork 0
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:
Markus Schorn 2006-10-05 12:56:12 +00:00
parent fd2c99b278
commit 2b21a7091f

View file

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