Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Fixed destructure error.

Mike Cao39562d4a6452
diff --git a/pages/api/send.ts b/pages/api/send.ts
index ec5f55b3b..e241e5de1 100644
--- a/pages/api/send.ts
+++ b/pages/api/send.ts
@@ -116,7 +116,7 @@ export default async (req: NextApiRequestCollect, res: NextApiResponse) => {
};
function validateBody(res: NextApiResponse, { type, payload }: CollectRequestBody) {
- const { data } = payload;
+ const { data } = payload || {};
// Validate type
if (type !== COLLECTION_TYPE.event && type !== COLLECTION_TYPE.identify) {