diff --git a/modules/enet/enet_packet_peer.cpp b/modules/enet/enet_packet_peer.cpp index ecc4afe486e..35e15b3ee13 100644 --- a/modules/enet/enet_packet_peer.cpp +++ b/modules/enet/enet_packet_peer.cpp @@ -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; }