summary refs log tree commit diff
path: root/src/util
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-04-24 11:14:17 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-04-24 11:14:17 +0200
commit2c39b659a59bb308a1221c1ab949f774ed195e7c (patch)
treed22e62ed6629b9411480379ae0e48d8770add267 /src/util
parent:bug: fix member model (diff)
downloadserver-2c39b659a59bb308a1221c1ab949f774ed195e7c.tar.xz
:art: String trimSpecial pass string OR undefined
Diffstat (limited to 'src/util')
-rw-r--r--src/util/String.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/util/String.ts b/src/util/String.ts
index 407b669d..161336f1 100644
--- a/src/util/String.ts
+++ b/src/util/String.ts
@@ -1,5 +1,6 @@
 import { DOUBLE_WHITE_SPACE, SPECIAL_CHAR } from "./Regex";
 
-export function trimSpecial(str: string) {
+export function trimSpecial(str?: string) {
+	if (!str) return;
 	return str.replace(SPECIAL_CHAR, "").replace(DOUBLE_WHITE_SPACE, " ").trim();
 }