From 96c3e6f3e627e601d388f9884b81d896d82f5f1e Mon Sep 17 00:00:00 2001 From: Squibid Date: Sun, 15 Oct 2023 07:04:07 -0400 Subject: add nil checks --- eatit.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eatit.lua b/eatit.lua index 8bc1545..efc1f0a 100644 --- a/eatit.lua +++ b/eatit.lua @@ -47,6 +47,7 @@ end local function run(cmd) local x = io.popen(cmd) + if not x then return 1 end local y = x:read("*a") x:close() return y @@ -58,6 +59,7 @@ local function openlog() fn = mp.command_native({'expand-path', opts.logging.logfile}) f = io.open(fn, 'a') -- open file buffer + if not f then return 1 end io.output(f) -- set it as default end end -- cgit v1.2.1