Add empty check

This commit is contained in:
Ed Lu 2024-08-07 11:18:56 -07:00
parent fb5659fbc6
commit 4f25c2ab36
1 changed files with 2 additions and 0 deletions

View File

@ -176,6 +176,8 @@ int ENetPacketPeer::get_channels() const {
}
int ENetPacketPeer::get_packet_flags() const {
ERR_FAIL_NULL_V(peer, ERR_UNCONFIGURED);
ERR_FAIL_COND_V(packet_queue.is_empty(), ERR_UNAVAILABLE);
return packet_queue.front()->get()->flags;
}