diff --git a/libraries/integration/Microsoft.Bot.Builder.Integration.AspNet.Core/BotFrameworkHttpClient.cs b/libraries/integration/Microsoft.Bot.Builder.Integration.AspNet.Core/BotFrameworkHttpClient.cs index d513b52475..e681749110 100644 --- a/libraries/integration/Microsoft.Bot.Builder.Integration.AspNet.Core/BotFrameworkHttpClient.cs +++ b/libraries/integration/Microsoft.Bot.Builder.Integration.AspNet.Core/BotFrameworkHttpClient.cs @@ -211,7 +211,15 @@ protected virtual async Task BuildCredentialsAsync(string appId, private static T GetBodyContent(string content) { - return JsonConvert.DeserializeObject(content); + try + { + return JsonConvert.DeserializeObject(content); + } + catch (JsonException) + { + // This will only happen when the skill didn't return valid json in the content (e.g. when the status code is 500 or there's a bug in the skill) + return default; + } } private async Task> SecurePostActivityAsync(Uri toUrl, Activity activity, string token, CancellationToken cancellationToken)