diff --git a/src/Infrastructure/BotSharp.Core/Translation/TranslationService.cs b/src/Infrastructure/BotSharp.Core/Translation/TranslationService.cs index 97e997c7c..ec33f609d 100644 --- a/src/Infrastructure/BotSharp.Core/Translation/TranslationService.cs +++ b/src/Infrastructure/BotSharp.Core/Translation/TranslationService.cs @@ -121,7 +121,7 @@ private void Collect(T data, ref HashSet res) where T : class if (data == null) return; var dataType = data.GetType(); - if (IsStringType(dataType)) + if (IsStringType(dataType) && !string.IsNullOrWhiteSpace(data.ToString())) { res.Add(data.ToString()); return; @@ -139,7 +139,7 @@ private void Collect(T data, ref HashSet res) where T : class { foreach (var item in (data as IEnumerable)) { - if (item == null) continue; + if (string.IsNullOrWhiteSpace(item)) continue; res.Add(item); } }