diff --git a/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp b/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp index 2247dabbda..dad0844beb 100644 --- a/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp +++ b/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp @@ -260,11 +260,18 @@ void InputBackend::HotplugThreadFunc() list_ports.pad_request_count = SERVER_ASKED_PADS; list_ports.pad_ids = {0, 1, 2, 3}; msg.Finish(); - if (server.m_socket.send(&list_ports, sizeof list_ports, - sf::IpAddress::resolve(server.m_address).value(), - server.m_port) != sf::Socket::Status::Done) + if (std::optional server_ip = sf::IpAddress::resolve(server.m_address)) { - ERROR_LOG_FMT(CONTROLLERINTERFACE, "DualShockUDPClient HotplugThreadFunc send failed"); + if (server.m_socket.send(&list_ports, sizeof list_ports, *server_ip, server.m_port) != + sf::Socket::Status::Done) + { + ERROR_LOG_FMT(CONTROLLERINTERFACE, "DualShockUDPClient HotplugThreadFunc send failed"); + } + } + else + { + ERROR_LOG_FMT(CONTROLLERINTERFACE, "DualShockUDPClient failed to resolve {}", + server.m_address); } timed_out_servers[i] = true; }