# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1435413577 -7200
# Node ID 5e8a8319699d5367d2b5516391c317e76d9b3b26
# Parent  79318d5484658a4baafdc4d1b65ee9e3844770c1
mod_storage_sql2: Validate configuration after normalizing SQLite3 database path (fixes traceback with default config)

diff -r 79318d548465 -r 5e8a8319699d plugins/mod_storage_sql2.lua
--- 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