From 06a30e0458f549a5ca6504175c0be3371041af4e Mon Sep 17 00:00:00 2001 From: Skull <86374920+skkuull@users.noreply.github.com> Date: Sun, 1 Jan 2023 18:37:06 +0300 Subject: [PATCH] small fix --- .../demonware/services/bdMarketingComms.cpp | 33 ++++++++++++------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/src/client/game/demonware/services/bdMarketingComms.cpp b/src/client/game/demonware/services/bdMarketingComms.cpp index 655ba3a6..48b4f52a 100644 --- a/src/client/game/demonware/services/bdMarketingComms.cpp +++ b/src/client/game/demonware/services/bdMarketingComms.cpp @@ -15,24 +15,33 @@ namespace demonware { auto motd_content = utils::http::get_data("https://h1.gg/data/motd.json"); auto motd = new bdMarketingMessage; - motd->m_messageID = 1; - motd->m_languageCode = "en-US"; - motd->m_content = motd_content.value().buffer.data(); - motd->m_metadata = "{}"; + if (motd_content.has_value()) + { + motd->m_messageID = 1; + motd->m_languageCode = "en-US"; + motd->m_content = motd_content.value().buffer.data(); + motd->m_metadata = "{}"; + } auto featured_content = utils::http::get_data("https://h1.gg/data/featured.json"); auto featured = new bdMarketingMessage; - featured->m_messageID = 2; - featured->m_languageCode = "en-US"; - featured->m_content = featured_content.value().buffer.data(); - featured->m_metadata = "{}"; + if (featured_content.has_value()) + { + featured->m_messageID = 2; + featured->m_languageCode = "en-US"; + featured->m_content = featured_content.value().buffer.data(); + featured->m_metadata = "{}"; + } auto featured2_content = utils::http::get_data("https://h1.gg/data/featured2.json"); auto featured2 = new bdMarketingMessage; - featured2->m_messageID = 3; - featured2->m_languageCode = "en-US"; - featured2->m_content = featured2_content.value().buffer.data(); - featured2->m_metadata = "{}"; + if (featured2_content.has_value()) + { + featured2->m_messageID = 3; + featured2->m_languageCode = "en-US"; + featured2->m_content = featured2_content.value().buffer.data(); + featured2->m_metadata = "{}"; + } auto reply = server->create_reply(this->task_id()); reply->add(motd);