1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-25 18:05:33 +02:00

Bug 339501: NPE in Call Hierarchy.

This commit is contained in:
Markus Schorn 2011-03-28 14:56:45 +00:00
parent 33f54a1614
commit 725a53f6da

View file

@ -28,6 +28,7 @@ import org.eclipse.cdt.core.index.IIndexName;
import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.core.model.ISourceReference;
import org.eclipse.cdt.core.model.ITranslationUnit;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ClassTypeHelper;
import org.eclipse.cdt.internal.core.model.ext.ICElementHandle;
@ -57,7 +58,11 @@ public class CHQueries {
boolean done= false;
int linkageID= node.getLinkageID();
if (linkageID == -1) {
final String ct = ((ISourceReference) callee).getTranslationUnit().getContentTypeId();
final ITranslationUnit tu = ((ISourceReference) callee).getTranslationUnit();
if (tu == null)
return EMPTY_NODES;
final String ct = tu.getContentTypeId();
if (ct.equals(CCorePlugin.CONTENT_TYPE_CXXHEADER)) {
// bug 260262: in a header file we need to consider c and c++
findCalledBy(callee, ILinkage.C_LINKAGE_ID, index, result);