Merge pull request #706 from BlipRanger/patch-4

Quick patch for overzealous checking
This commit is contained in:
RossAscends
2023-07-14 14:14:14 +09:00
committed by GitHub

View File

@@ -1057,7 +1057,7 @@ app.post("/editcharacterattribute", jsonParser, async function (request, respons
charaRead(avatarPath).then((char) => { charaRead(avatarPath).then((char) => {
char = JSON.parse(char); char = JSON.parse(char);
//check if the field exists //check if the field exists
if (char[request.body.field] === undefined || char.data[request.body.field] === undefined) { if (char[request.body.field] === undefined && char.data[request.body.field] === undefined) {
console.error('Error: invalid field.'); console.error('Error: invalid field.');
response.status(400).send('Error: invalid field.'); response.status(400).send('Error: invalid field.');
return; return;