Skip to content

Commit 1890840

Browse files
author
Marc Chambers
authored
Add nil check when opening file in todot (#28)
1 parent 98c2ff4 commit 1890840

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

statemachine.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ end
120120

121121
function machine:todot(filename)
122122
local dotfile = io.open(filename,'w')
123+
assert(dotfile~=nil)
123124
dotfile:write('digraph {\n')
124125
local transition = function(event,from,to)
125126
dotfile:write(string.format('%s -> %s [label=%s];\n',from,to,event))

0 commit comments

Comments
 (0)