From de9234618e2873d26dbb3701ac8041d82524f055 Mon Sep 17 00:00:00 2001 From: Alexander Date: Fri, 25 Aug 2023 10:22:28 +0300 Subject: [PATCH] Return max BPM as common BPM if there are no timing points --- src/Beatmaps/Beatmap.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Beatmaps/Beatmap.ts b/src/Beatmaps/Beatmap.ts index b38511e..81ddfa1 100644 --- a/src/Beatmaps/Beatmap.ts +++ b/src/Beatmaps/Beatmap.ts @@ -156,6 +156,10 @@ export class Beatmap implements IBeatmap { * The most common BPM of a beatmap. */ get bpm(): number { + if (!this.controlPoints.timingPoints.length) { + return this.bpmMax; + } + const timingPoints = this.controlPoints.timingPoints; const hitObjects = this.hitObjects;