From 650338d25b8fbe6991650d852f9de32772b5fe9f Mon Sep 17 00:00:00 2001 From: MathieuG-P <40181755+Zagrios@users.noreply.github.com> Date: Sat, 10 Aug 2024 15:34:07 +0200 Subject: [PATCH] [bugfix-542] Fix crash when exclude map tag when browsing for new maps --- .../services/thrid-party/beat-saver/beat-saver-api.service.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/services/thrid-party/beat-saver/beat-saver-api.service.ts b/src/main/services/thrid-party/beat-saver/beat-saver-api.service.ts index 8cd4e1e8..8b61cd61 100644 --- a/src/main/services/thrid-party/beat-saver/beat-saver-api.service.ts +++ b/src/main/services/thrid-party/beat-saver/beat-saver-api.service.ts @@ -35,7 +35,8 @@ export class BeatSaverApiService { const enbledTagsString = filter.enabledTags ? Array.from(filter.enabledTags) : null; const excludedTagsString = filter.excludedTags ? Array.from(filter.excludedTags).map(tag => `!${tag}`) : null; - const tags = enbledTagsString || excludedTagsString ? [...enbledTagsString, excludedTagsString].join("|") : null; + let tags = [...(enbledTagsString ?? []), ...(excludedTagsString ?? [])].join("|"); + tags = tags.length > 0 ? tags : null; const params: Record = this.objectToStringRecord({...filter, tags});