diff --git a/Chatbase/Client.cs b/Chatbase/Client.cs index e8c9b18..b2c6c5d 100644 --- a/Chatbase/Client.cs +++ b/Chatbase/Client.cs @@ -189,16 +189,16 @@ public async Task Send(FBAgentMessageSet set) private Message setMessageWithClientProperties(Message msg) { - if (!String.IsNullOrEmpty(api_key)) { + if (!String.IsNullOrWhiteSpace(api_key)) { msg.api_key = api_key; } - if (!String.IsNullOrEmpty(user_id)) { + if (!String.IsNullOrWhiteSpace(user_id)) { msg.user_id = user_id; } - if (!String.IsNullOrEmpty(platform)) { + if (!String.IsNullOrWhiteSpace(platform)) { msg.platform = platform; } - if (!String.IsNullOrEmpty(version)) { + if (!String.IsNullOrWhiteSpace(version)) { msg.version = version; } diff --git a/Chatbase/FBAgentMessage.cs b/Chatbase/FBAgentMessage.cs index d4a8d2f..d8c4c8e 100644 --- a/Chatbase/FBAgentMessage.cs +++ b/Chatbase/FBAgentMessage.cs @@ -48,7 +48,7 @@ public class FBAgentMessage public bool RequiredFieldsSet() { - return !String.IsNullOrEmpty(api_key); + return !String.IsNullOrWhiteSpace(api_key); } public FBAgentMessage SetRecipientID(string id) diff --git a/Chatbase/FBUserMessage.cs b/Chatbase/FBUserMessage.cs index 0cddc19..2071306 100644 --- a/Chatbase/FBUserMessage.cs +++ b/Chatbase/FBUserMessage.cs @@ -57,10 +57,10 @@ public class FBUserMessage public bool RequiredFieldsSet() { return !( - String.IsNullOrEmpty(sender.id) - || String.IsNullOrEmpty(recipient.id) - || String.IsNullOrEmpty(message.mid) - || String.IsNullOrEmpty(api_key) + String.IsNullOrWhiteSpace(sender.id) + || String.IsNullOrWhiteSpace(recipient.id) + || String.IsNullOrWhiteSpace(message.mid) + || String.IsNullOrWhiteSpace(api_key) ); } diff --git a/Chatbase/Message.cs b/Chatbase/Message.cs index 0a2d110..61fe01d 100755 --- a/Chatbase/Message.cs +++ b/Chatbase/Message.cs @@ -68,10 +68,10 @@ public static double CurrentUnixMilliseconds() public bool RequiredFieldsSet() { return !( - String.IsNullOrEmpty(api_key) - || String.IsNullOrEmpty(type) - || String.IsNullOrEmpty(user_id) - || String.IsNullOrEmpty(platform) + String.IsNullOrWhiteSpace(api_key) + || String.IsNullOrWhiteSpace(type) + || String.IsNullOrWhiteSpace(user_id) + || String.IsNullOrWhiteSpace(platform) ); }