File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
NetworkingManagerComponents/Binary Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -216,9 +216,9 @@ public string GetChannel()
216216 public class NetworkedVarString : NetworkedVar < string >
217217 {
218218 /// <inheritdoc />
219- public NetworkedVarString ( ) { }
219+ public NetworkedVarString ( ) : base ( string . Empty ) { }
220220 /// <inheritdoc />
221- public NetworkedVarString ( NetworkedVarSettings settings ) : base ( settings ) { }
221+ public NetworkedVarString ( NetworkedVarSettings settings ) : base ( settings , string . Empty ) { }
222222 /// <inheritdoc />
223223 public NetworkedVarString ( string value ) : base ( value ) { }
224224 /// <inheritdoc />
Original file line number Diff line number Diff line change @@ -97,6 +97,10 @@ public void WriteObjectPacked(object value)
9797 }
9898 else if ( value is string )
9999 {
100+ if ( value == null )
101+ {
102+ throw new ArgumentException ( "BitWriter cannot write strings with a null value" ) ;
103+ }
100104 WriteStringPacked ( ( string ) value ) ;
101105 return ;
102106 }
@@ -186,8 +190,12 @@ public void WriteObjectPacked(object value)
186190 WriteUInt16Packed ( ( ( NetworkedBehaviour ) value ) . GetBehaviourId ( ) ) ;
187191 return ;
188192 }
189- else if ( value is IBitWritable )
193+ else if ( value is IBitWritable )
190194 {
195+ if ( value == null )
196+ {
197+ throw new ArgumentException ( "BitWriter cannot write IBitWritable types with a null value" ) ;
198+ }
191199 ( ( IBitWritable ) value ) . Write ( this . sink ) ;
192200 return ;
193201 }
You can’t perform that action at this time.
0 commit comments