summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-03-03 23:07:34 +0100
committerGitHub <noreply@github.com>2021-03-03 23:07:34 +0100
commit44e73473c6af24bc83ed2ec40a1c0162624dd8fc (patch)
treec0df0e51a7235ff4fa160859a777140faf9a497b
parent338fa05accd5eccdbf5fa4f47f53b9ad85ca96e4 (diff)
parenta3a731ed92aec7a7a99b369d84d9f11fcbec5642 (diff)
Merge pull request #46573 from pdfrod/fix-crash-on-httpclient-poll
Fix crash on HTTPClient::poll method
-rw-r--r--core/io/http_client.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp
index 18afdc678e..3863dce0f6 100644
--- a/core/io/http_client.cpp
+++ b/core/io/http_client.cpp
@@ -96,6 +96,11 @@ 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.");
+ if (ssl) {
+ ERR_FAIL_NULL_MSG(Object::cast_to<StreamPeerSSL>(p_connection.ptr()),
+ "Connection is not a reference to a valid StreamPeerSSL object.");
+ }
+
if (connection == p_connection) {
return;
}