diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2019-11-23 10:15:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-23 10:15:45 +0100 |
commit | 9b2073aa97770ae7f53cfa57d241c55bb2feb3d3 (patch) | |
tree | e62405deb1bdb57195a1c7c57b44bb958b98a5a7 /core/io | |
parent | 91b60a74dfbbc23bf589a6e0edda5b957aa48df3 (diff) | |
parent | b73073ae364be8db377c28f71be4dc50b4883263 (diff) |
Merge pull request #33652 from Black-Cat/http-client-fix
Fix HTTPClient::poll crash when connection set to null
Diffstat (limited to 'core/io')
-rw-r--r-- | core/io/http_client.cpp | 2 |
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; |