.get returns null when the property is not present

This commit is contained in:
Manav Rathi 2024-05-24 09:49:20 +05:30
parent 623b71715d
commit 59ed89cba1
No known key found for this signature in database

View file

@ -79,7 +79,7 @@ const parseAccount = (url: URL): string | undefined => {
const parseIssuer = (url: URL): string => { const parseIssuer = (url: URL): string => {
// If there is a "issuer" search param, use that. // If there is a "issuer" search param, use that.
let issuer = url.searchParams.get("issuer"); let issuer = url.searchParams.get("issuer");
if (issuer !== undefined) { if (issuer) {
// This is to handle bug in old versions of Ente Auth app. // This is to handle bug in old versions of Ente Auth app.
if (issuer.endsWith("period")) { if (issuer.endsWith("period")) {
issuer = issuer.substring(0, issuer.length - 6); issuer = issuer.substring(0, issuer.length - 6);