fix(java_indexer): guard against NPE in ImmutableList
@@ -660,11 +660,9 @@ public class KytheTreeScanner extends JCTreeScanner<JavaNode, TreeContext> {
emitAnchor(ctx, EdgeKind.DEFINES, lambdaNode);
for (Type target : getTargets(lambda)) {
- if (target != null) {
VName targetNode = getNode(target.asElement());
entrySets.emitEdge(lambdaNode, EdgeKind.EXTENDS, targetNode);
}
- }
scan(lambda.body, ctx);
scanList(lambda.params, ctx);
@@ -672,6 +670,9 @@ public class KytheTreeScanner extends JCTreeScanner<JavaNode, TreeContext> {
}
private static Iterable<Type> getTargets(JCFunctionalExpression node) {
+ if (node == null || node.target == null) {
+ return ImmutableList.of();
+ }
return ImmutableList.of(node.target);
}
