fix dofile of nil filename

This commit is contained in:
chrox
2014-07-04 01:41:24 +08:00
parent 7f03fc10be
commit a3a4e7f7fb

View File

@@ -55,9 +55,9 @@ function DocSettings:open(docfile)
sidecar_file = sidecar_path,
data = {}
}
local ok, stored = pcall(dofile, new.history_file)
local ok, stored = pcall(dofile, new.history_file or "")
if not ok then
ok, stored = pcall(dofile, new.sidecar_file)
ok, stored = pcall(dofile, new.sidecar_file or "")
if not ok then
-- try legacy conf path, for backward compatibility. this also
-- takes care of reader legacy setting