diff options
-rw-r--r-- | otfl-font-nms.lua | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua index 935500c..d7a5847 100644 --- a/otfl-font-nms.lua +++ b/otfl-font-nms.lua @@ -510,16 +510,18 @@ local function scan_os_fonts(fontnames, newfontnames) logs.report("executing 'fc-list : file' and parsing its result...") end local data = io.popen("fc-list : file", 'r') - local list = read_fcdata(data) - data:close() - if trace_search then - logs.report("%d fonts found", #list) - end - count = 0 - for _,fnt in ipairs(list) do - count = count + 1 - progress(count, #list) - load_font(fnt, fontnames, newfontnames, false) + if data then + local list = read_fcdata(data) + data:close() + if trace_search then + logs.report("%d fonts found", #list) + end + count = 0 + for _,fnt in ipairs(list) do + count = count + 1 + progress(count, #list) + load_font(fnt, fontnames, newfontnames, false) + end end end end |