@@ -19,8 +19,8 @@ interface PlayerPosition {
1919}
2020
2121type RTCSignalData =
22- | { type : 'offer' ; sdp : RTCSessionDescriptionInit | null }
23- | { type : 'answer' ; sdp : RTCSessionDescriptionInit | null }
22+ | { type : 'offer' ; sdp : RTCSessionDescriptionInit }
23+ | { type : 'answer' ; sdp : RTCSessionDescriptionInit }
2424 | { type : 'ice-candidate' ; candidate : RTCIceCandidateInit } ;
2525
2626function toPartialPlayerPosition ( data : unknown ) : Partial < PlayerPosition > {
@@ -39,7 +39,7 @@ function isRTCSignalData(signal: unknown): signal is RTCSignalData {
3939 if ( ! signal || typeof signal !== 'object' ) return false ;
4040 const parsed = signal as Record < string , unknown > ;
4141 if ( parsed . type === 'offer' || parsed . type === 'answer' ) {
42- return parsed . sdp === null || typeof parsed . sdp === 'object' ;
42+ return typeof parsed . sdp === 'object' && parsed . sdp !== null ;
4343 }
4444 if ( parsed . type === 'ice-candidate' ) {
4545 return typeof parsed . candidate === 'object' && parsed . candidate !== null ;
@@ -521,7 +521,6 @@ export class MultiplayerManager {
521521 const rtcSignal = signal ;
522522
523523 if ( rtcSignal . type === 'offer' ) {
524- if ( ! rtcSignal . sdp ) return ;
525524 await this . initWebRTCConnection ( fromId , false ) ;
526525 const pc = this . peerConnections . get ( fromId ) ;
527526 if ( ! pc ) return ;
@@ -534,7 +533,6 @@ export class MultiplayerManager {
534533 signal : { type : 'answer' , sdp : pc . localDescription } ,
535534 } ) ;
536535 } else if ( rtcSignal . type === 'answer' ) {
537- if ( ! rtcSignal . sdp ) return ;
538536 const pc = this . peerConnections . get ( fromId ) ;
539537 if ( pc ) {
540538 await pc . setRemoteDescription (
0 commit comments