(cherry picked from commit e4b9b37ccf8495be674bc15cf0bf9d76fe94e6be)
@@ -154,6 +154,10 @@ Error PacketPeerUDPPosix::wait() {
Error PacketPeerUDPPosix::_poll(bool p_wait) {
+ if (sockfd == -1) {
+ return FAILED;
+ }
+
struct sockaddr_storage from = { 0 };
socklen_t len = sizeof(struct sockaddr_storage);
int ret;
@@ -149,6 +149,10 @@ Error PacketPeerUDPWinsock::wait() {
}
Error PacketPeerUDPWinsock::_poll(bool p_wait) {
_set_blocking(p_wait);