         nodes.push({name: state.name})
 
     for state in stateList
-        for tr in state.transitions
+        for tr in state.transitions or []
             target = stateMap[tr.target]
             links.push({source: state._idx, target: target._idx})
 

    return size


top = svg.append('g')
    .attr('transform', "translate(#{width/2}, #{height/2})")
layout(top, tree)

layout = (g, stateList) ->
    nodes = []
    links = []
