Skip to content

Commit 17793b4

Browse files
danielwergworr
authored andcommitted
Fix undefined "end_year"
1 parent 5f67c96 commit 17793b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/imdb.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ export class TVShow extends Movie {
437437
*/
438438
constructor(obj: OmdbTvshow, opts: MovieOpts) {
439439
super(obj);
440-
const years = this._yearData.split("-");
440+
const years = this._yearData.split(/[-]/);
441441
this.start_year = parseInt(years[0], 10);
442442
this.end_year = parseInt(years[1], 10) ? parseInt(years[1], 10) : undefined;
443443
this.totalseasons = parseInt(obj.totalSeasons, 10);

0 commit comments

Comments
 (0)