From ba854c2dec109f3402ac9018aae5011be457fc98 Mon Sep 17 00:00:00 2001 From: Jicheng Lu <103353@smsassist.com> Date: Tue, 23 Apr 2024 11:27:20 -0500 Subject: [PATCH] minor change --- .../BotSharp.Core/Translation/TranslationService.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Infrastructure/BotSharp.Core/Translation/TranslationService.cs b/src/Infrastructure/BotSharp.Core/Translation/TranslationService.cs index b0dca0eb..7ca79892 100644 --- a/src/Infrastructure/BotSharp.Core/Translation/TranslationService.cs +++ b/src/Infrastructure/BotSharp.Core/Translation/TranslationService.cs @@ -37,6 +37,8 @@ public class TranslationService : ITranslationService private T Clone(T data) where T : class { + if (data == null) return data; + var str = System.Text.Json.JsonSerializer.Serialize(data, _options.JsonSerializerOptions); var cloned = System.Text.Json.JsonSerializer.Deserialize(str, _options.JsonSerializerOptions); return cloned;