Skip to content

Commit

Permalink
BUGFIX: Prevent NullpointerException in PrototypeLineMarkerProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
cvette committed Jan 8, 2018
1 parent cda3975 commit 9669bda
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -56,7 +57,8 @@ public void collectSlowLineMarkers(@NotNull List<PsiElement> 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(":");

Expand Down

0 comments on commit 9669bda

Please sign in to comment.