From 9669bda81ea0a1a90a648c359c1589ec4a49429d Mon Sep 17 00:00:00 2001 From: Christian Vette Date: Mon, 8 Jan 2018 21:52:19 +0100 Subject: [PATCH] BUGFIX: Prevent NullpointerException in PrototypeLineMarkerProvider --- .../lang/yaml/annotators/PrototypeLineMarkerProvider.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/vette/idea/neos/lang/yaml/annotators/PrototypeLineMarkerProvider.java b/src/main/java/de/vette/idea/neos/lang/yaml/annotators/PrototypeLineMarkerProvider.java index e4bdc48f..fc55e750 100644 --- a/src/main/java/de/vette/idea/neos/lang/yaml/annotators/PrototypeLineMarkerProvider.java +++ b/src/main/java/de/vette/idea/neos/lang/yaml/annotators/PrototypeLineMarkerProvider.java @@ -29,6 +29,7 @@ import org.jetbrains.annotations.Nullable; import org.jetbrains.yaml.psi.YAMLDocument; import org.jetbrains.yaml.psi.YAMLKeyValue; +import org.jetbrains.yaml.psi.YAMLMapping; import java.util.Collection; import java.util.List; @@ -56,7 +57,8 @@ public void collectSlowLineMarkers(@NotNull List elements, @NotNull continue; } - if (((YAMLKeyValue) el).getParentMapping().getParent() instanceof YAMLDocument) { + YAMLMapping parentMapping = ((YAMLKeyValue) el).getParentMapping(); + if (parentMapping != null && parentMapping.getParent() instanceof YAMLDocument) { String nodeType = ((YAMLKeyValue) el).getKeyText(); String[] nodeTypeSplit = nodeType.split(":");