Skip to content

Commit

Permalink
New JSON class changes
Browse files Browse the repository at this point in the history
  • Loading branch information
qcapen committed Jun 18, 2019
1 parent 1aad0a1 commit 9a71e1b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Assets/BCP/Scripts/BcpMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public static JSONNode ConvertBcpParameterStringToNode(string value)
return new JSONBool(value.Substring(5));

else if (value.ToLower().StartsWith("nonetype:"))
return new JSONNull();
return JSONNull.CreateOrGet();

else if (value.ToLower().StartsWith("int:"))
return new JSONNumber(value.Substring(4));
Expand Down Expand Up @@ -241,7 +241,7 @@ public static BcpMessage CreateFromRawMessage(string rawMessage)
// BCP commands are not case sensitive so we convert to lower case
// BCP parameter names are not case sensitive, but parameter values are
bcpMessage.Command = rawMessage.Substring(0, messageDelimiterPos).Trim().ToLower();
rawMessage = rawMessage.Substring(rawMessage.IndexOf('?') + 1);
rawMessage = rawMessage.Substring(messageDelimiterPos + 1);

foreach (string parameter in Regex.Split(rawMessage, "&"))
{
Expand All @@ -261,7 +261,7 @@ public static BcpMessage CreateFromRawMessage(string rawMessage)
}
catch
{
bcpMessage.Parameters.Add(name, new JSONNull());
bcpMessage.Parameters.Add(name, JSONNull.CreateOrGet());
}
else
{
Expand All @@ -272,7 +272,7 @@ public static BcpMessage CreateFromRawMessage(string rawMessage)
else
{
// only one key with no value specified in query string
bcpMessage.Parameters.Add(name, new JSONNull());
bcpMessage.Parameters.Add(name, JSONNull.CreateOrGet());
}
}

Expand Down

0 comments on commit 9a71e1b

Please sign in to comment.