fix(admin): add optional chaining to safely access settings properties

This commit is contained in:
Mauricio Siu
2025-12-21 01:35:21 -06:00
parent b2be5bc09f
commit 1ccb205495
+4 -4
View File
@@ -110,9 +110,9 @@ export const getDokployUrl = async () => {
} }
const settings = await getWebServerSettings(); const settings = await getWebServerSettings();
if (settings.host) { if (settings?.host) {
const protocol = settings.https ? "https" : "http"; const protocol = settings?.https ? "https" : "http";
return `${protocol}://${settings.host}`; return `${protocol}://${settings?.host}`;
} }
return `http://${settings.serverIp}:${process.env.PORT}`; return `http://${settings?.serverIp}:${process.env.PORT}`;
}; };