Check db url before attempting to get a user id.

This commit is contained in:
vdv committed 2023-04-15 17:29:50 +02:00
1 parent 09e82600aa
commit b38fdf49ad
1 file changed
+6 -2
+6 -2
View File
@@ -32,5 +32,9 @@ export const parseDbUrl = (urlString: string) => {
return { username: hex2a(encodedUser), database: urlString };
};
export const dbUrlToUserId = (urlString: string) =>
userId(parseDbUrl(urlString));
export const dbUrlToUserId = (urlString: string) => {
if (!urlString) {
return null;
}
return userId(parseDbUrl(urlString));
};