Skip to content

Commit

Permalink
fix(api): check if workflow data is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
sguiheux authored and richardlt committed Jan 17, 2020
1 parent cc78eac commit a423ce2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sdk/workflow_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ func (w *WorkflowData) Array() []*Node {

func (w *WorkflowData) Maps() map[int64]*Node {
nodes := make(map[int64]*Node, 0)
if w == nil {
return nodes
}
nodes = w.Node.maps(nodes)
for i := range w.Joins {
nodes = w.Joins[i].maps(nodes)
Expand All @@ -71,6 +74,9 @@ func (w *WorkflowData) Maps() map[int64]*Node {
}

func (w *WorkflowData) NodeByRef(ref string) *Node {
if w == nil {
return nil
}
n := (&w.Node).nodeByRef(ref)
if n != nil {
return n
Expand All @@ -85,6 +91,9 @@ func (w *WorkflowData) NodeByRef(ref string) *Node {
}

func (w *WorkflowData) NodeByID(ID int64) *Node {
if w == nil {
return nil
}
n := (&w.Node).nodeByID(ID)
if n != nil {
return n
Expand Down

0 comments on commit a423ce2

Please sign in to comment.