Skip to content

Commit 98566b1

Browse files
committed
check nil
1 parent f416c7f commit 98566b1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

script/utility.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,9 @@ function m.loadFile(path, keepBom)
290290
end
291291
local text = f:read 'a'
292292
f:close()
293+
if not text then
294+
return nil
295+
end
293296
if not keepBom then
294297
if text:sub(1, 3) == '\xEF\xBB\xBF' then
295298
return text:sub(4)

0 commit comments

Comments
 (0)