diff options
author | Jon Bratseth <bratseth@gmail.com> | 2022-02-20 21:54:08 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2022-02-20 21:54:08 +0100 |
commit | b20c35742fef3bdb76f8f8a844a6a55a7bfb17e1 (patch) | |
tree | dd720425a3eb26ef1ee3cd8dbcde08c1c0c798a6 /integration | |
parent | 8aead4aa69fc415aa90bf31b8e41e3cad4f600d4 (diff) |
Tolerate null schema
Diffstat (limited to 'integration')
-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); } |