valid if object exists

This commit is contained in:
Sam Machin
2025-12-19 11:49:33 +00:00
parent 8f4355cdd2
commit 550b3b0e6e
+2 -2
View File
@@ -103,13 +103,13 @@ async function validateUpdate(req, sid) {
}
let urlError;
if (req.body.call_hook.url) {
if (req.body.call_hook) {
urlError = await isInvalidUrl(req.body.call_hook.url);
if (urlError) {
throw new DbErrorBadRequest(`call_hook ${urlError}`);
}
}
if (req.body.call_status_hook.url) {
if (req.body.call_status_hook) {
urlError = await isInvalidUrl(req.body.call_status_hook.url);
if (urlError) {
throw new DbErrorBadRequest(`call_status_hook ${urlError}`);