2
0
Эх сурвалжийг харах

Fixes HTTPClient::poll crash after connection is self-assigned

(cherry picked from commit 8226cee8d875af8e89cfc79fd94cb430203867b4)
Haoyu Qiu 5 жил өмнө
parent
commit
9119560d4d

+ 4 - 0
core/io/http_client.cpp

@@ -100,6 +100,10 @@ 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;