Check db url before attempting to get a user id.
This commit is contained in:
parent
09e82600aa
commit
b38fdf49ad
|
@ -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));
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue