File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -36,11 +36,11 @@ public static string RemoveDefaultNullProperties(this JToken token)
3636 {
3737 RemoveDefaultNullProperties ( property . Value ) ;
3838 }
39- else if ( property . Value . Type == JTokenType . String && property . Value . ToString ( ) == "defaultnull" )
39+ else if ( property . Value . Type == JTokenType . String && property . Value . ToString ( ) . Equals ( "defaultnull" , StringComparison . Ordinal ) )
4040 {
4141 property . Remove ( ) ;
4242 }
43- else if ( property . Value . Type == JTokenType . String && property . Value . ToString ( ) == "null" )
43+ else if ( property . Value . Type == JTokenType . String && property . Value . ToString ( ) . Equals ( "null" , StringComparison . Ordinal ) )
4444 {
4545 property . Value = JValue . CreateNull ( ) ;
4646 }
@@ -57,11 +57,11 @@ public static string RemoveDefaultNullProperties(this JToken token)
5757 {
5858 RemoveDefaultNullProperties ( item ) ;
5959 }
60- else if ( item . Type == JTokenType . String && item . ToString ( ) == "defaultnull" )
60+ else if ( item . Type == JTokenType . String && item . ToString ( ) . Equals ( "defaultnull" , StringComparison . Ordinal ) )
6161 {
6262 jsonArray . RemoveAt ( i ) ; // Remove the "defaultnull" string from the array
6363 }
64- else if ( item . Type == JTokenType . String && item . ToString ( ) == "null" )
64+ else if ( item . Type == JTokenType . String && item . ToString ( ) . Equals ( "null" , StringComparison . Ordinal )
6565 {
6666 jsonArray [ i ] = JValue . CreateNull ( ) ; // Convert "null" string to actual null
6767 }
You can’t perform that action at this time.
0 commit comments