From aded9653e0f6de4b5e950230c41e3a16e8dff7ea Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Thu, 2 Jun 2011 17:18:23 +0100 Subject: migrator/prosody_files: Don't choke on empty data stores for a user (thanks @eoranged) --- tools/migration/migrator/prosody_files.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tools/migration/migrator/prosody_files.lua') diff --git a/tools/migration/migrator/prosody_files.lua b/tools/migration/migrator/prosody_files.lua index 4e42f564..be0c49f8 100644 --- a/tools/migration/migrator/prosody_files.lua +++ b/tools/migration/migrator/prosody_files.lua @@ -98,7 +98,12 @@ function reader(input) local x = iter(); if x then dm.set_data_path(path); - x.data = assert(dm.load(x.user, x.host, x.store)); + local err; + x.data, err = dm.load(x.user, x.host, x.store); + if x.data == nil and err then + error(("Error loading data at path %s for %s@%s (%s store)") + :format(path, x.user or "", x.host or "", x.store or ""), 0); + end return x; end end; -- cgit v1.2.3