Skip to content

Commit

Permalink
Merge pull request nglviewer#989 from fredludlow/check-null-params
Browse files Browse the repository at this point in the history
Broaden undefined check when applying representation parameters.
  • Loading branch information
ppillot committed Jun 11, 2023
2 parents 32dd1da + 1ef29d8 commit bac4aec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/representation/representation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ class Representation {

for (let name in p) {
if (p[ name ] === undefined) continue
if (tp[ name ] === undefined) continue
if (tp[ name ] == undefined ) continue // Skip nulls as well as undefined

if (tp[ name ].int) p[ name ] = parseInt(p[ name ] as string)
if (tp[ name ].float) p[ name ] = parseFloat(p[ name ] as string)
Expand Down

0 comments on commit bac4aec

Please sign in to comment.