Skip to content

Commit

Permalink
Add WebSocketMultiplayerPeer _incoming_packets check bound
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxStgs committed Apr 30, 2021
1 parent 66f696c commit 05ad089
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/websocket/websocket_multiplayer_peer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 05ad089

Please sign in to comment.