add nil checks
This commit is contained in:
@ -47,6 +47,7 @@ end
|
|||||||
|
|
||||||
local function run(cmd)
|
local function run(cmd)
|
||||||
local x = io.popen(cmd)
|
local x = io.popen(cmd)
|
||||||
|
if not x then return 1 end
|
||||||
local y = x:read("*a")
|
local y = x:read("*a")
|
||||||
x:close()
|
x:close()
|
||||||
return y
|
return y
|
||||||
@ -58,6 +59,7 @@ local function openlog()
|
|||||||
fn = mp.command_native({'expand-path', opts.logging.logfile})
|
fn = mp.command_native({'expand-path', opts.logging.logfile})
|
||||||
|
|
||||||
f = io.open(fn, 'a') -- open file buffer
|
f = io.open(fn, 'a') -- open file buffer
|
||||||
|
if not f then return 1 end
|
||||||
io.output(f) -- set it as default
|
io.output(f) -- set it as default
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user