From 6bbb16dcb9f821e6f71bbfa9f0b4b12167907f43 Mon Sep 17 00:00:00 2001 From: IcePixelx <41352111+PixieCore@users.noreply.github.com> Date: Fri, 14 Jan 2022 20:39:11 +0100 Subject: [PATCH] Fix sendrequest crash. Due to htResults being null. --- r5dev/networksystem/r5net.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/r5dev/networksystem/r5net.cpp b/r5dev/networksystem/r5net.cpp index 5a14a271..4c6bd289 100644 --- a/r5dev/networksystem/r5net.cpp +++ b/r5dev/networksystem/r5net.cpp @@ -34,7 +34,7 @@ std::vector R5Net::Client::GetServersList(std::string& svOutMessa httplib::Result htResults = m_HttpClient.Post("/servers", jsReqBody.dump().c_str(), jsReqBody.dump().length(), "application/json"); - if (r5net_show_debug->GetBool()) + if (htResults && r5net_show_debug->GetBool()) { DevMsg(eDLL_T::ENGINE, "GetServerList replied with '%d'.\n", htResults->status); } @@ -132,7 +132,7 @@ bool R5Net::Client::PostServerHost(std::string& svOutMessage, std::string& svOut httplib::Result htResults = m_HttpClient.Post("/servers/add", svRequestBody.c_str(), svRequestBody.length(), "application/json"); - if (r5net_show_debug->GetBool()) + if (htResults && r5net_show_debug->GetBool()) { DevMsg(eDLL_T::ENGINE, "PostServerHost replied with '%d'.\n", htResults->status); }