Fix exception caused by invalid con req URL

This commit is contained in:
Divya Jagadish authored and Zaid Humaimidi committed 2024-03-09 13:14:38 -08:00
1 parent 227a005400
commit 6962cedba9
1 file changed
+6 -2
+6 -2
View File
@@ -100,8 +100,12 @@ export async function connectionRequest(
device["Device.ManagementServer.ConnectionRequestPassword"] || {}
).value || [""])[0];
}
const remoteAddress = new URL(connectionRequestUrl).hostname;
let remoteAddress;
try {
remoteAddress = new URL(connectionRequestUrl).hostname;
} catch (err) {
return "Invalid connection request URL";
}
const evalCallback = (exp): Expression => {
if (!Array.isArray(exp)) return exp;