fix: prevent server crash on empty payloads
All checks were successful
Build and Deploy / build-and-push (push) Successful in 39s
All checks were successful
Build and Deploy / build-and-push (push) Successful in 39s
This commit is contained in:
@@ -14,9 +14,9 @@ export const handleTinyOrderUpdate = async (req: Request, res: Response): Promis
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let payload = req.body;
|
let payload = req.body || {};
|
||||||
|
|
||||||
if (typeof payload.dados === 'string') {
|
if (payload && typeof payload.dados === 'string') {
|
||||||
try {
|
try {
|
||||||
payload.dados = JSON.parse(payload.dados);
|
payload.dados = JSON.parse(payload.dados);
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|||||||
Reference in New Issue
Block a user