Skip to content

Commit 3694956

Browse files
committed
fix: noteCount and duration are possibly null in search param assignment
1 parent 3664c2c commit 3694956

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

  • apps/frontend/src/app/(content)/search

apps/frontend/src/app/(content)/search/page.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -479,10 +479,11 @@ const SearchSongPage = () => {
479479
category,
480480
uploader,
481481
limit,
482-
noteCountMin: noteCountMin > 0 ? noteCountMin : undefined,
483-
noteCountMax: noteCountMax < 10000 ? noteCountMax : undefined,
484-
durationMin: durationMin > 0 ? durationMin : undefined,
485-
durationMax: durationMax < 10000 ? durationMax : undefined,
482+
noteCountMin: noteCountMin && noteCountMin > 0 ? noteCountMin : undefined,
483+
noteCountMax:
484+
noteCountMax && noteCountMax < 10000 ? noteCountMax : undefined,
485+
durationMin: durationMin && durationMin > 0 ? durationMin : undefined,
486+
durationMax: durationMax && durationMax < 10000 ? durationMax : undefined,
486487
features: features || undefined,
487488
instruments: instruments || undefined,
488489
};

0 commit comments

Comments
 (0)