@@ -39,8 +39,8 @@ export class BoardGameGeekAPI extends APIModel {
3939 let ret : MediaTypeModel [ ] = [ ] ;
4040
4141 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 ! ;
4444 const year = boardgame . querySelector ( "yearpublished" ) ?. textContent ?? "" ;
4545
4646 ret . push ( new BoardGameModel ( {
@@ -71,12 +71,12 @@ export class BoardGameGeekAPI extends APIModel {
7171 const response = new window . DOMParser ( ) . parseFromString ( data , "text/xml" )
7272 debugLog ( response ) ;
7373
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 ! ) ;
8080
8181 const model = new BoardGameModel ( {
8282 type : MediaType . BoardGame ,
0 commit comments