util.datamanager: Check that the global 'prosody' exists before using it (fixes nil...
authorKim Alvefur <zash@zash.se>
Fri, 20 Feb 2015 18:00:01 +0000 (19:00 +0100)
committerKim Alvefur <zash@zash.se>
Fri, 20 Feb 2015 18:00:01 +0000 (19:00 +0100)
util/datamanager.lua

index 4a4d62b3c098519f361912162f9a73e30209c960..b82349f10957bd31d186cb00664902adce63784f 100644 (file)
@@ -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)