summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script/utility.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/script/utility.lua b/script/utility.lua
index 66beaf07..7f9d559b 100644
--- a/script/utility.lua
+++ b/script/utility.lua
@@ -290,6 +290,9 @@ function m.loadFile(path, keepBom)
end
local text = f:read 'a'
f:close()
+ if not text then
+ return nil
+ end
if not keepBom then
if text:sub(1, 3) == '\xEF\xBB\xBF' then
return text:sub(4)