about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-03-18 10:40:47 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-03-18 10:43:48 -0700
commit7dc0928f52eb5ab795292d300808aac06b4564b5 (patch)
tree39671d6044d74a0f3a2d43180a4ccf3a875d93f3
parent29d53c21acc746c9e0f20211cb665e731a13bf82 (diff)
downloadteliva-7dc0928f52eb5ab795292d300808aac06b4564b5.tar.gz
graphviz: show error when lacking permissions
-rw-r--r--graphviz.tlv10
1 files changed, 6 insertions, 4 deletions
diff --git a/graphviz.tlv b/graphviz.tlv
index 3757c0b..54a6404 100644
--- a/graphviz.tlv
+++ b/graphviz.tlv
@@ -501,11 +501,13 @@
 - __teliva_timestamp: original
   read_dot_file:
     >function read_dot_file(filename)
-    >  local infile = start_reading(nil, filename)
-    >  local chars = graphviz_buffered_reader(infile)
-    >  local tokens = graphviz_tokenizer(chars)
     >  local graph = {}
-    >  parse_graph(tokens, graph)
+    >  local infile = start_reading(nil, filename)
+    >  if infile then
+    >    local chars = graphviz_buffered_reader(infile)
+    >    local tokens = graphviz_tokenizer(chars)
+    >    parse_graph(tokens, graph)
+    >  end
     >  return graph
     >end
 - __teliva_timestamp: original