Merge pull request #42684 from timothyqiu/conn-self-assign

Fix HTTPClient::poll crash after connection is self-assigned
This commit is contained in:
Fabio Alessandrelli 2020-10-12 12:40:22 +02:00 committed by GitHub
commit ab0907c1ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -96,6 +96,10 @@ 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 (connection == p_connection) {
return;
}
close();
connection = p_connection;
status = STATUS_CONNECTED;