@@ -39,8 +39,8 @@ export class BoardGameGeekAPI extends APIModel {
39
39
let ret : MediaTypeModel [ ] = [ ] ;
40
40
41
41
for ( const boardgame of Array . from ( response . querySelectorAll ( "boardgame" ) ) ) {
42
- const id = boardgame . attributes . getNamedItem ( "objectid" ) . value ;
43
- const title = boardgame . querySelector ( "name" ) . textContent ;
42
+ const id = boardgame . attributes . getNamedItem ( "objectid" ) ! . value ;
43
+ const title = boardgame . querySelector ( "name" ) ! . textContent ! ;
44
44
const year = boardgame . querySelector ( "yearpublished" ) ?. textContent ?? "" ;
45
45
46
46
ret . push ( new BoardGameModel ( {
@@ -71,12 +71,12 @@ export class BoardGameGeekAPI extends APIModel {
71
71
const response = new window . DOMParser ( ) . parseFromString ( data , "text/xml" )
72
72
debugLog ( response ) ;
73
73
74
- const boardgame = response . querySelector ( "boardgame" ) ;
75
- const title = boardgame . querySelector ( "name" ) . textContent ;
76
- const year = boardgame . querySelector ( "yearpublished" ) . textContent ;
77
- const image = boardgame . querySelector ( "image" ) . textContent ;
78
- const onlineRating = Number . parseFloat ( boardgame . querySelector ( "statistics ratings average" ) . textContent ) ;
79
- const genres = Array . from ( boardgame . querySelectorAll ( "boardgamecategory" ) ) . map ( n => n . textContent ) ;
74
+ const boardgame = response . querySelector ( "boardgame" ) ! ;
75
+ const title = boardgame . querySelector ( "name" ) ! . textContent ! ;
76
+ const year = boardgame . querySelector ( "yearpublished" ) ? .textContent ?? "" ;
77
+ const image = boardgame . querySelector ( "image" ) ? .textContent ?? undefined ;
78
+ const onlineRating = Number . parseFloat ( boardgame . querySelector ( "statistics ratings average" ) ? .textContent ?? "" ) ;
79
+ const genres = Array . from ( boardgame . querySelectorAll ( "boardgamecategory" ) ) . map ( n => n ! . textContent ! ) ;
80
80
81
81
const model = new BoardGameModel ( {
82
82
type : MediaType . BoardGame ,
0 commit comments