Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

add try catch

Steven Teyc816867a9bb0
diff --git a/packages/utils/src/functions/punycode.ts b/packages/utils/src/functions/punycode.ts
index 2f842078ee..f78f05604a 100644
--- a/packages/utils/src/functions/punycode.ts
+++ b/packages/utils/src/functions/punycode.ts
@@ -2,7 +2,11 @@ import punycodeHelper from "punycode/";
export function punycode(str?: string | null) {
if (typeof str !== "string") return "";
- return punycodeHelper.toUnicode(str);
+ try {
+ return punycodeHelper.toUnicode(str);
+ } catch (e) {
+ return str;
+ }
}
export function punyEncode(str?: string | null) {