From e3a12983e9550bb0a53654120ebf876da747f436 Mon Sep 17 00:00:00 2001 From: undefined Date: Mon, 12 Aug 2024 16:48:58 +0800 Subject: [PATCH] center: fix --- packages/center/index.ts | 4 ++-- packages/center/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/center/index.ts b/packages/center/index.ts index 1e3939dd5..14d7c8f71 100644 --- a/packages/center/index.ts +++ b/packages/center/index.ts @@ -63,7 +63,7 @@ class DataReportHandler extends Handler { sandbox: payload.sandbox, dbVersion: payload.dbVersion, }; - if (old.notification) setPayload.notification = ''; + if (old?.notification) setPayload.notification = ''; if (old && lt(payload.version, old.version)) { await coll.updateOne( { _id: installId }, @@ -86,7 +86,7 @@ class DataReportHandler extends Handler { this.ctx.emit('center/report', this, installId, old, payload); // TODO deliver messages this.response.body = { code: 0 }; - if (old.notification) this.response.body.notification = old.notification; + if (old.notification) this.response.body.notification = old?.notification; } } diff --git a/packages/center/package.json b/packages/center/package.json index c87eca141..026b614a5 100644 --- a/packages/center/package.json +++ b/packages/center/package.json @@ -1,6 +1,6 @@ { "name": "@hydrooj/center", - "version": "0.2.8", + "version": "0.2.9", "main": "index.ts", "repository": "https://github.com/hydro-dev/Hydro.git", "author": "undefined ",