From b73073ae364be8db377c28f71be4dc50b4883263 Mon Sep 17 00:00:00 2001 From: Artem Burjachenko Date: Sat, 16 Nov 2019 11:16:26 +0400 Subject: [PATCH] Fix HTTPClient::poll crash when connection set to null --- core/io/http_client.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp index 170bef44305..9d541c4fa74 100644 --- a/core/io/http_client.cpp +++ b/core/io/http_client.cpp @@ -98,6 +98,8 @@ Error HTTPClient::connect_to_host(const String &p_host, int p_port, bool p_ssl, void HTTPClient::set_connection(const Ref &p_connection) { + ERR_FAIL_COND_MSG(p_connection.is_null(), "Connection is not a reference to a valid StreamPeer object."); + close(); connection = p_connection; status = STATUS_CONNECTED;