From 383ccf09d73fee397115fb56d4bdf53efa94739c Mon Sep 17 00:00:00 2001 From: Dev Date: Mon, 17 Jun 2024 15:35:49 +0100 Subject: [PATCH] Added nullguard protection to `serialize()` for bundle loading --- project/src/routers/serializers/BundleSerializer.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/project/src/routers/serializers/BundleSerializer.ts b/project/src/routers/serializers/BundleSerializer.ts index efc0bb00..dfd51dce 100644 --- a/project/src/routers/serializers/BundleSerializer.ts +++ b/project/src/routers/serializers/BundleSerializer.ts @@ -27,6 +27,12 @@ export class BundleSerializer extends Serializer } this.logger.info(`[BUNDLE]: ${req.url}`); + if (!bundle.modpath) + { + this.logger.error(`Mod: ${key} lacks a modPath property, skipped loading`); + + return; + } this.httpFileUtil.sendFile(resp, `${bundle.modpath}/bundles/${bundle.filename}`); }