fix "TypeError: Cannot use 'in' operator to search for 'Title' in undefined"

This commit is contained in:
Ashley 2022-12-24 12:28:41 +00:00
parent ab1bb9bd45
commit ecac0323b7

View file

@ -175,6 +175,10 @@ module.exports = function (app, config, renderTemplate) {
const engagement = data.engagement;
var inv_comments = data.comments;
const inv_vid = data.vid;
//checks if json exists
if (json) {
//checks if title exists in the json object
if ("Title" in json) {
if (!data.comments) inv_comments = "Disabled";
@ -232,6 +236,7 @@ module.exports = function (app, config, renderTemplate) {
});
}
}
}
} else {
res.redirect("/");
}