From 0979b1c30a9c02dbb34635c7d7b96e27d731eb39 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 20 Feb 2015 19:00:01 +0100 Subject: util.datamanager: Check that the global 'prosody' exists before using it (fixes nil indexing in use outside of prosody) --- util/datamanager.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- cgit v1.2.3