From 488c9d87541903c2614a10f9aae2776c2e8c7fb2 Mon Sep 17 00:00:00 2001 From: Salanto <62221668+Salanto@users.noreply.github.com> Date: Tue, 17 May 2022 20:28:07 +0200 Subject: [PATCH] Fix Discord Webhook not working unless webhook_color has a value in the config (#262) * Set default properly If this slight hack is not done, Akashi may load an empty color code, causing Discord to reject the Webhook due to an empty value. --- core/src/config_manager.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/src/config_manager.cpp b/core/src/config_manager.cpp index 58bbd09..f465366 100644 --- a/core/src/config_manager.cpp +++ b/core/src/config_manager.cpp @@ -473,7 +473,14 @@ QString ConfigManager::discordUptimeWebhookUrl() QString ConfigManager::discordWebhookColor() { - return m_discord->value("Discord/webhook_color","13312842").toString(); + const QString l_default_color = "13312842"; + QString l_color = m_discord->value("Discord/webhook_color", l_default_color).toString(); + if (l_color.isEmpty()) { + return l_default_color; + } + else { + return l_color; + } } bool ConfigManager::passwordRequirements()