You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Improve use of Ref.is_null/valid
Use `is_null` over `!is_valid` and vice versa.
This commit is contained in:
committed by
AThousandShips
parent
0f95e9f8e6
commit
a1846b27ea
@@ -293,7 +293,7 @@ Error WebRTCMultiplayerPeer::add_peer(Ref<WebRTCPeerConnection> p_peer, int p_pe
|
||||
ERR_FAIL_COND_V(p_unreliable_lifetime < 0, ERR_INVALID_PARAMETER);
|
||||
ERR_FAIL_COND_V(is_refusing_new_connections(), ERR_UNAUTHORIZED);
|
||||
// Peer must be valid, and in new state (to create data channels)
|
||||
ERR_FAIL_COND_V(!p_peer.is_valid(), ERR_INVALID_PARAMETER);
|
||||
ERR_FAIL_COND_V(p_peer.is_null(), ERR_INVALID_PARAMETER);
|
||||
ERR_FAIL_COND_V(p_peer->get_connection_state() != WebRTCPeerConnection::STATE_NEW, ERR_INVALID_PARAMETER);
|
||||
|
||||
Ref<ConnectedPeer> peer = memnew(ConnectedPeer);
|
||||
|
||||
Reference in New Issue
Block a user