Skip to content

Commit

Permalink
Merge pull request #9 from kionell/bpm-fix
Browse files Browse the repository at this point in the history
Fix crash when trying to get BPM of a beatmap that doesn't have timing points
  • Loading branch information
kionell authored Oct 26, 2023
2 parents 9c7f303 + de92346 commit e76d74d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Beatmaps/Beatmap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit e76d74d

Please sign in to comment.