Skip to content

Commit

Permalink
fix(player): return default value for uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
egorprnn committed Mar 6, 2022
1 parent bf98b66 commit 15905cb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/contexts/player/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,10 +427,16 @@ export class PlayerContext extends Context<PlayerContext> {
return Number(id) || 0;
}

const { attribs: { href } } = $(`a[href^="/profile/${this.username}"].nav-link`)
const link = $(`a[href^="/profile/${this.username}"].nav-link`)
.get(0);

return Number(href.split('.').pop()) || 0;
if (link) {
const { attribs: { href } } = link;

return Number(href.split('.').pop()) || 0;
}

return 0;
}

/**
Expand Down

0 comments on commit 15905cb

Please sign in to comment.