File tree Expand file tree Collapse file tree
src/main/java/edu/uiowa/slis/graphtaglib Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,7 +24,14 @@ public int doStartTag() throws JspException {
2424
2525 if (theIterator == null ) {
2626 logger .trace ("Adding edge source: " + source + "\t target: " + target + "\t weight: " + weight );
27- theGraph .addEdge (new GraphEdge (theGraph .getNode (source ), theGraph .getNode (target ), weight ));
27+ GraphNode sourceNode = theGraph .getNode (source );
28+ GraphNode targetNode = theGraph .getNode (target );
29+ if (sourceNode == null ) {
30+ logger .error ("source node missing for edge <" + source + ", " + target + ">" );
31+ } else if (targetNode == null ) {
32+ logger .error ("target node missing for edge <" + source + ", " + target + ">" );
33+ } else
34+ theGraph .addEdge (new GraphEdge (sourceNode , targetNode , weight ));
2835 return SKIP_BODY ;
2936 } else {
3037 currentEdge = theIterator .currentEdge ;
You can’t perform that action at this time.
0 commit comments