Merge pull request #33652 from Black-Cat/http-client-fix

Fix HTTPClient::poll crash when connection set to null
This commit is contained in:
Fabio Alessandrelli 2019-11-23 10:15:45 +01:00 committed by GitHub
commit 9b2073aa97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;