diff options
Diffstat (limited to 'integration/intellij/src/main')
-rw-r--r-- | integration/intellij/src/main/java/ai/vespa/intellij/schema/model/RankProfile.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/integration/intellij/src/main/java/ai/vespa/intellij/schema/model/RankProfile.java b/integration/intellij/src/main/java/ai/vespa/intellij/schema/model/RankProfile.java index 10ecde68ff9..05cc08f2bc9 100644 --- a/integration/intellij/src/main/java/ai/vespa/intellij/schema/model/RankProfile.java +++ b/integration/intellij/src/main/java/ai/vespa/intellij/schema/model/RankProfile.java @@ -51,16 +51,18 @@ public class RankProfile { */ public Map<String, RankProfile> parents() { if (parents != null) return parents; + if (owner == null) return Map.of(); // Some code paths do not yet instantiate from a schema return parents = AST.inherits(definition).stream() .map(parentIdentifierAST -> parentIdentifierAST.getPsi().getReference()) .filter(reference -> reference != null) .map(reference -> owner.rankProfiles().get(reference.getCanonicalText())) - .filter(r -> r != null) - .collect(Collectors.toMap(p -> p.name(), p -> p)); + .filter(profile -> profile != null) + .collect(Collectors.toMap(profile -> profile.name(), profile -> profile)); } public List<RankProfile> children() { if (children != null) return children; + if (owner == null) return List.of(); // Some code paths do not yet instantiate from a schema return children = children(owner); } |