]> granicus.if.org Git - graphviz/commitdiff
add some more safety checks for NULL parameters.
authorellson <devnull@localhost>
Tue, 18 Oct 2005 21:11:47 +0000 (21:11 +0000)
committerellson <devnull@localhost>
Tue, 18 Oct 2005 21:11:47 +0000 (21:11 +0000)
tclpkg/gv/gv.cpp

index 3e6f3bb6ac1e141e31ff76d2cf9e8f434bdfc09e..029c9b09ac44272c6bd2b940e51cbd4593b041e1 100644 (file)
@@ -611,11 +611,15 @@ Agedge_t *nextout(Agraph_t *g, Agedge_t *e)
 
 Agedge_t *firstedge(Agraph_t *g)
 {
+    if (!g)
+       return NULL;
     return firstout(g);
 } 
 
 Agedge_t *nextedge(Agraph_t *g, Agedge_t *e)
 {
+    if (!g || !e)
+       return NULL;
     return nextout(g, e);
 } 
 
@@ -748,11 +752,15 @@ Agnode_t *nexttail(Agnode_t *n, Agnode_t *t)
 
 Agnode_t *firstnode(Agraph_t *g)
 {
+    if (!g)
+       return NULL;
     return agfstnode(g);
 }
 
 Agnode_t *nextnode(Agraph_t *g, Agnode_t *n)
 {
+    if (!g || !n)
+       return NULL;
     return agnxtnode(g, n);
 }