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

Bug 532684 - NPE in PDOMMacroReferenceName constructor

Change-Id: Iea6200203350591927f505213facc9224243cc65
This commit is contained in:
Nathan Ridge 2018-03-22 18:46:08 -04:00
parent 0f9d2cdbba
commit d598331c81

View file

@ -56,8 +56,8 @@ public final class PDOMMacroReferenceName implements IIndexFragmentName {
// Record our location in the file // Record our location in the file
IASTFileLocation fileloc = name.getFileLocation(); IASTFileLocation fileloc = name.getFileLocation();
db.putInt(record + NODE_OFFSET_OFFSET, fileloc.getNodeOffset()); db.putInt(record + NODE_OFFSET_OFFSET, fileloc != null ? fileloc.getNodeOffset() : 0);
db.putShort(record + NODE_LENGTH_OFFSET, (short) fileloc.getNodeLength()); db.putShort(record + NODE_LENGTH_OFFSET, fileloc != null ? (short) fileloc.getNodeLength() : 0);
container.addReference(this); container.addReference(this);
if (caller != null) { if (caller != null) {