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 {
369369 cell . childElementCount === 0 ||
370370 ! cell . children [ 0 ] ||
371371 cell . children [ 0 ] . tagName === "I"
372- )
372+ ) {
373373 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+
374383 let i = 0 ;
375384 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 ++ ) {
377386 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+ }
379391 let stat = camelize ( ( < HTMLElement > cell . children [ i ] ) . title . replace ( / [ ^ \w ] / g, "" ) ) ;
380392 if ( ! isStat ( stat ) ) {
381393 console . log ( "Irregular Stat " , stat ) ;
You can’t perform that action at this time.
0 commit comments