Skip to content

Commit 2c59176

Browse files
authored
fix: Handle an unparseable connection string in the connection pooling page (supabase#20538)
Add a try catch if the connection string can't be parsed.
1 parent c61643f commit 2c59176

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

apps/studio/components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.utils.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ export const constructConnStringSyntax = (
4949
}
5050

5151
export const getPoolerTld = (connString: string) => {
52-
const segment = connString.split('pooler.supabase.')[1]
53-
const tld = segment.split(':6543')[0]
54-
return tld
52+
try {
53+
const segment = connString.split('pooler.supabase.')[1]
54+
const tld = segment.split(':6543')[0]
55+
return tld
56+
} catch {
57+
return 'com'
58+
}
5559
}

0 commit comments

Comments
 (0)