Skip to content

Commit 3d4041c

Browse files
committed
Fix issue with search results without yearpublished tag
1 parent 47d5927 commit 3d4041c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/api/apis/BoardGameGeekAPI.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ export class BoardGameGeekAPI extends APIModel {
4141
for (const boardgame of Array.from(response.querySelectorAll("boardgame"))) {
4242
const id = boardgame.attributes.getNamedItem("objectid").value;
4343
const title = boardgame.querySelector("name").textContent;
44-
const year = boardgame.querySelector("yearpublished").textContent;
44+
const year = boardgame.querySelector("yearpublished")?.textContent ?? "";
4545

4646
ret.push(new BoardGameModel({
4747
dataSource: this.apiName,
4848
id,
4949
title,
5050
englishTitle: title,
51-
year,
51+
year,
5252
} as BoardGameModel));
5353
}
5454

@@ -82,7 +82,7 @@ export class BoardGameGeekAPI extends APIModel {
8282
type: MediaType.BoardGame,
8383
title,
8484
englishTitle: title,
85-
year,
85+
year: year === "0" ? "" : year,
8686
dataSource: this.apiName,
8787
url: `https://boardgamegeek.com/boardgame/${id}`,
8888
id,

0 commit comments

Comments
 (0)