Skip to content

Commit 7d99ad8

Browse files
authored
Merge pull request #500 from yileicn/OptimizeTranslate
Update TranslationService.cs
2 parents ce24ed9 + 57b522f commit 7d99ad8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Infrastructure/BotSharp.Core/Translation/TranslationService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ private void Collect<T>(T data, ref HashSet<string> res) where T : class
121121
if (data == null) return;
122122

123123
var dataType = data.GetType();
124-
if (IsStringType(dataType))
124+
if (IsStringType(dataType) && !string.IsNullOrWhiteSpace(data.ToString()))
125125
{
126126
res.Add(data.ToString());
127127
return;
@@ -139,7 +139,7 @@ private void Collect<T>(T data, ref HashSet<string> res) where T : class
139139
{
140140
foreach (var item in (data as IEnumerable<string>))
141141
{
142-
if (item == null) continue;
142+
if (string.IsNullOrWhiteSpace(item)) continue;
143143
res.Add(item);
144144
}
145145
}

0 commit comments

Comments
 (0)