diff --git a/res/res_pjsip_config_wizard.c b/res/res_pjsip_config_wizard.c
index 3a761a7c7e0e334be441ce3ffec7fa138db806a6..4d24922880ef6be3d583faf2aff62bc6f7a3ad5f 100644
--- a/res/res_pjsip_config_wizard.c
+++ b/res/res_pjsip_config_wizard.c
@@ -910,8 +910,12 @@ static int handle_registrations(const struct ast_sorcery *sorcery, struct object
 		client_uri_pattern = "sip:${USERNAME}@${REMOTE_HOST}";
 	}
 
-	if(is_variable_true(wizvars, "sends_auth")) {
-		username = ast_variable_find_last_in_list(wizvars, "outbound_auth/username");
+	if (is_variable_true(wizvars, "sends_auth")) {
+		if (!(username = ast_variable_find_last_in_list(wizvars, "outbound_auth/username"))) {
+			ast_log(LOG_ERROR, "Wizard '%s' must have 'outbound_auth/username' if it sends"
+				" authentication.\n", id);
+			return -1;
+		}
 	} else {
 		username = id;
 	}