Diff

plugins/mod_storage_sql2.lua @ 6746:5e8a8319699d

mod_storage_sql2: Validate configuration after normalizing SQLite3 database path (fixes traceback with default config)
author Kim Alvefur <zash@zash.se>
date Sat, 27 Jun 2015 15:59:37 +0200
parent 6740:99b3f29c3c71
child 6749:9dc05d3efdc9
child 6754:c72b00dade25
line wrap: on
line diff
--- a/plugins/mod_storage_sql2.lua	Thu Jun 25 18:54:01 2015 +0200
+++ b/plugins/mod_storage_sql2.lua	Sat Jun 27 15:59:37 2015 +0200
@@ -379,10 +379,10 @@
 end
 
 local function normalize_params(params)
-	assert(params.driver and params.database, "Configuration error: Both the SQL driver and the database need to be specified");
 	if params.driver == "SQLite3" then
 		params.database = resolve_relative_path(prosody.paths.data or ".", params.database or "prosody.sqlite");
 	end
+	assert(params.driver and params.database, "Configuration error: Both the SQL driver and the database need to be specified");
 	return params;
 end