From 71548d2ff4851a046a22b5461fed71e33d282adc Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Wed, 8 Nov 2023 12:22:21 +0100 Subject: [PATCH] Added a security check to the main.cpp --- src/main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 920eee2..924a8b8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -15,9 +15,15 @@ using namespace sql; int main(int argc, char **argv) { json configuration = config::read_config(argc < 2 ? CONFIG_PATH : argv[1]); - Connection *con = util::createConnection(configuration["database"]); + if (con == nullptr) { + std::cout << "Could not connect too database"; + return 1; + } + + std::cout << "Using database " << con->getSchema() << std::endl; + cluster bot(configuration["token"], dpp::i_default_intents | dpp::i_message_content); bot.on_log(dpp::utility::cout_logger());