summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index 1c02a0b..55125e0 100644
--- a/init.lua
+++ b/init.lua
@@ -183,7 +183,11 @@ function lib.init(config)
elseif config.text then
temp = true
path = os.tmpname()
- io.open(path, "w"):write(config.text):close()
+ local file = io.open(path, "w")
+ if file then
+ file:write(config.text)
+ file:close()
+ end
else
return false
end