Commit 382ef7a4 authored by Philip Makedonski's avatar Philip Makedonski
Browse files

* fixed NPE due to unresolved references

parent 94759bf9
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -370,8 +370,11 @@ public class DependencyAnalyzer implements Callable<TTCN3Dependency> {
		TreeMap<String, EObject> offsetCrossReferences = new TreeMap<>();
		for (EObject o : crossReferences.keySet()) {
			int offset = NodeModelUtils.getNode(crossReferences.get(o).iterator().next().getEObject()).getOffset();
			offset = NodeModelUtils.getNode(crossReferences.get(o).iterator().next().getEObject()).getOffset();
			int targetOffset = NodeModelUtils.getNode(o).getOffset();
			int targetOffset = -1;
			ICompositeNode targetNode = NodeModelUtils.getNode(o);
			if (targetNode!=null) {
				targetOffset = targetNode.getOffset();
			}
			//TODO: there ought to be more elegant way but it's hard to get the exact offset of the reference
			offsetCrossReferences.put(offset+"->"+targetOffset, o);
		}