Skip to content

Commit

Permalink
fix(queue): add check for null on bridge property (#1925)
Browse files Browse the repository at this point in the history
Updated GuildQueuePlayerNode (totalDuration) to check if bridge property is set properly (is not null) to prevent an error

Co-authored-by: Twilight <[email protected]>
  • Loading branch information
Kamiloo13 and twlite authored Jul 26, 2024
1 parent 630dc0f commit 2725277
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/discord-player/src/queue/GuildQueuePlayerNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export class GuildQueuePlayerNode<Meta = unknown> {
const prefersBridgedMetadata = this.queue.options.preferBridgedMetadata;
const track = this.queue.currentTrack;

if (prefersBridgedMetadata && track?.metadata != null && typeof track.metadata === 'object' && 'bridge' in track.metadata) {
if (prefersBridgedMetadata && track?.metadata != null && typeof track.metadata === 'object' && 'bridge' in track.metadata && track.metadata.bridge != null) {
const duration = (
track as Track<{
bridge: {
Expand Down

0 comments on commit 2725277

Please sign in to comment.