summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorArtem Burjachenko <iblackcatw@gmail.com>2019-11-16 11:16:26 +0400
committerArtem Burjachenko <iblackcatw@gmail.com>2019-11-23 11:06:14 +0400
commitb73073ae364be8db377c28f71be4dc50b4883263 (patch)
treed306b7e304d9dd8ca5a15c7d548e0a0222506e86 /core
parent98caeb635c2e4d48e0d6d6dbd82af183ab83f894 (diff)
Fix HTTPClient::poll crash when connection set to null
Diffstat (limited to 'core')
-rw-r--r--core/io/http_client.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp
index 170bef4430..9d541c4fa7 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<StreamPeer> &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;