fix(slack): guard against undefined text in includes calls during mention handling

This commit is contained in:
stone-jin
2026-03-03 00:02:48 +08:00
committed by Peter Steinberger
parent ce4faedad6
commit 2a98fd3d0b
4 changed files with 33 additions and 0 deletions

View File

@@ -28,6 +28,9 @@ function isAllowedSlackAngleToken(token: string): boolean {
}
function escapeSlackMrkdwnContent(text: string): string {
if (!text) {
return "";
}
if (!text.includes("&") && !text.includes("<") && !text.includes(">")) {
return text;
}
@@ -53,6 +56,9 @@ function escapeSlackMrkdwnContent(text: string): string {
}
function escapeSlackMrkdwnText(text: string): string {
if (!text) {
return "";
}
if (!text.includes("&") && !text.includes("<") && !text.includes(">")) {
return text;
}