Skip to content

Commit 65ffe84

Browse files
fix: update SplitAsTuple
1 parent 961d2b0 commit 65ffe84

File tree

1 file changed

+8
-2
lines changed
  • src/Infrastructure/BotSharp.Core/Infrastructures

1 file changed

+8
-2
lines changed

src/Infrastructure/BotSharp.Core/Infrastructures/Utilities.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,16 @@ public static string HashTextSha256(string text)
3030
return sb.ToString();
3131
}
3232

33-
public static (string, string) SplitAsTuple(this string str, string sep)
33+
public static (string, string, string) SplitAsTuple(this string str, string sep)
3434
{
3535
var splits = str.Split(sep);
36-
return (splits[0], splits[1]);
36+
37+
if (splits.Length == 2 || string.IsNullOrWhiteSpace(splits[2]))
38+
{
39+
return (splits[0], splits[1], "CN");
40+
}
41+
42+
return (splits[0], splits[1], splits[2]);
3743
}
3844

3945
/// <summary>

0 commit comments

Comments
 (0)