Skip to content

Commit 49bb41a

Browse files
committed
fix(user-ratings): when year is completely missing
1 parent cdd61b7 commit 49bb41a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/helpers/user-ratings.helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const getTitle = (el: HTMLElement): string => {
2626
};
2727

2828
export const getYear = (el: HTMLElement): number => {
29-
return +el.querySelectorAll('td.name .film-title-info .info')[0].text.slice(1, -1);
29+
return +el.querySelectorAll('td.name .film-title-info .info')[0]?.text.slice(1, -1) || null;
3030
};
3131

3232
export const getColorRating = (el: HTMLElement): CSFDColorRating => {

0 commit comments

Comments
 (0)