about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--file.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/file.lua b/file.lua
index d3ccca2..92561bd 100644
--- a/file.lua
+++ b/file.lua
@@ -30,6 +30,9 @@ end
 
 function save_to_disk(lines, filename)
   local outfile = App.open_for_writing(filename)
+  if outfile == nil then
+    error('failed to write to "'..filename..'"')
+  end
   for _,line in ipairs(lines) do
     if line.mode == 'drawing' then
       store_drawing(outfile, line)
1 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136