diff options
Diffstat (limited to 'core/io')
-rw-r--r-- | core/io/packet_peer.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/io/packet_peer.cpp b/core/io/packet_peer.cpp index 821a04ebad..23dfc58385 100644 --- a/core/io/packet_peer.cpp +++ b/core/io/packet_peer.cpp @@ -279,6 +279,7 @@ Ref<StreamPeer> PacketPeerStream::get_stream_peer() const { void PacketPeerStream::set_input_buffer_max_size(int p_max_size) { + ERR_FAIL_COND_MSG(p_max_size < 0, "Max size of input buffer size cannot be smaller than 0."); //warning may lose packets ERR_FAIL_COND_MSG(ring_buffer.data_left(), "Buffer in use, resizing would cause loss of data."); ring_buffer.resize(nearest_shift(p_max_size + 4)); |