Merge pull request #48333 from MaxStgs/master

Add WebSocketMultiplayerPeer _incoming_packets check bound
This commit is contained in:
Rémi Verschelde 2021-04-30 20:12:35 +02:00 committed by GitHub
commit 0ad03ba052
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -99,6 +99,8 @@ Error WebSocketMultiplayerPeer::get_packet(const uint8_t **r_buffer, int &r_buff
_current_packet.data = nullptr;
}
ERR_FAIL_COND_V(_incoming_packets.size() == 0, ERR_UNAVAILABLE);
_current_packet = _incoming_packets.front()->get();
_incoming_packets.pop_front();