From c54585b91c729ef71c2fd272dcf2675311f5a96a Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 11 Dec 2015 20:18:24 +0100 Subject: util.datamanager: Skip past second check if first attemtp to open file succeeds --- util/datamanager.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/datamanager.lua b/util/datamanager.lua index 4a371d2c..b7c514ad 100644 --- a/util/datamanager.lua +++ b/util/datamanager.lua @@ -214,9 +214,9 @@ local function append(username, host, datastore, ext, data) local f, msg = io_open(filename, "r+"); if not f then f, msg = io_open(filename, "w"); - end - if not f then - return nil, msg; + if not f then + return nil, msg; + end end local pos = f:seek("end"); local ok, msg = fallocate(f, pos, #data); -- cgit v1.2.3