File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -369,13 +369,25 @@ function parseStatsBonus(cell: Element): Bonus {
369
369
cell . childElementCount === 0 ||
370
370
! cell . children [ 0 ] ||
371
371
cell . children [ 0 ] . tagName === "I"
372
- )
372
+ ) {
373
373
return null ;
374
+ }
375
+
376
+ if ( cell . children [ 0 ] . tagName !== "SPAN" || ! cell . children [ 0 ] . children [ 0 ] ) {
377
+ console . log ( "undefined table tag" ) ;
378
+ return null ;
379
+ }
380
+
381
+ cell = cell . children [ 0 ] ;
382
+
374
383
let i = 0 ;
375
384
let statsBonus : Bonus = { applicable : [ ] , bonus : "" , stat : undefined } ;
376
- for ( ; cell . children [ i ] && cell . children [ i ] . tagName === "A" ; i ++ )
385
+ for ( ; cell . children [ i ] && cell . children [ i ] . tagName === "A" ; i ++ ) {
377
386
statsBonus . applicable . push ( ( < HTMLElement > cell . children [ i ] ) . title . replace ( / \( \w + \) / , "" ) . trim ( ) ) ;
378
- if ( ! cell . children [ i ] ) return null ;
387
+ }
388
+ if ( ! cell . children [ i ] ) {
389
+ return null ;
390
+ }
379
391
let stat = camelize ( ( < HTMLElement > cell . children [ i ] ) . title . replace ( / [ ^ \w ] / g, "" ) ) ;
380
392
if ( ! isStat ( stat ) ) {
381
393
console . log ( "Irregular Stat " , stat ) ;
You can’t perform that action at this time.
0 commit comments