Skip to content

Commit 15905cb

Browse files
committed
fix(player): return default value for uuid
1 parent bf98b66 commit 15905cb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/contexts/player/index.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,10 +427,16 @@ export class PlayerContext extends Context<PlayerContext> {
427427
return Number(id) || 0;
428428
}
429429

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

433-
return Number(href.split('.').pop()) || 0;
433+
if (link) {
434+
const { attribs: { href } } = link;
435+
436+
return Number(href.split('.').pop()) || 0;
437+
}
438+
439+
return 0;
434440
}
435441

436442
/**

0 commit comments

Comments
 (0)