Skip to content
This repository has been archived by the owner on Nov 5, 2018. It is now read-only.

Commit

Permalink
[server] another NPE guard
Browse files Browse the repository at this point in the history
  • Loading branch information
JanKoehnlein committed Aug 22, 2017
1 parent f030bc6 commit f547be1
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ class TraceRegionProvider {

def TextRegion getSignificantRegion(EObject element) {
val feature = element.relevantFeature
if (feature !== null)
return NodeModelUtils.findNodesForFeature(element, feature).head.toTextRegion
else
return NodeModelUtils.findActualNodeFor(element).toTextRegion
if (feature !== null) {
val node = NodeModelUtils.findNodesForFeature(element, feature).head
if(node !== null)
return node.toTextRegion
}
return NodeModelUtils.findActualNodeFor(element).toTextRegion
}

protected def toTextRegion(INode node) {
Expand Down

0 comments on commit f547be1

Please sign in to comment.