aboutsummaryrefslogtreecommitdiffstats
path: root/util/datamanager.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-02-20 19:00:01 +0100
committerKim Alvefur <zash@zash.se>2015-02-20 19:00:01 +0100
commit1c33e777ecf981e5982804317b543510de318eb3 (patch)
tree155cd362a6ba2138b30fa032c585b100431e409c /util/datamanager.lua
parent3425d38067fa73d76fc12016f6714fcfe0f0c9ca (diff)
downloadprosody-1c33e777ecf981e5982804317b543510de318eb3.tar.gz
prosody-1c33e777ecf981e5982804317b543510de318eb3.zip
util.datamanager: Check that the global 'prosody' exists before using it (fixes nil indexing in use outside of prosody)
Diffstat (limited to 'util/datamanager.lua')
-rw-r--r--util/datamanager.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/datamanager.lua b/util/datamanager.lua
index 4a4d62b3..b82349f1 100644
--- a/util/datamanager.lua
+++ b/util/datamanager.lua
@@ -163,7 +163,7 @@ local function atomic_store(filename, data)
return nil, msg;
end
-if prosody.platform ~= "posix" then
+if prosody and prosody.platform ~= "posix" then
-- os.rename does not overwrite existing files on Windows
-- TODO We could use Transactional NTFS on Vista and above
function atomic_store(filename, data)