Bugfix: Only fall back to default value if sanitizer returns undefined
Fixes #72
This commit is contained in:
parent
590a8e3740
commit
1b85707833
1 changed files with 11 additions and 2 deletions
|
@ -169,12 +169,21 @@ export default class SheetObject implements IdentityDerivationProvider {
|
|||
if (!triple)
|
||||
return valsAtom.setIn(pathToProp, propConfig!.default)
|
||||
|
||||
const left = sanitize(triple.left) || propConfig.default
|
||||
const leftSanitized = sanitize(triple.left)
|
||||
|
||||
const left =
|
||||
typeof leftSanitized === 'undefined'
|
||||
? propConfig.default
|
||||
: leftSanitized
|
||||
|
||||
if (triple.right === undefined)
|
||||
return valsAtom.setIn(pathToProp, left)
|
||||
|
||||
const right = sanitize(triple.right) || propConfig.default
|
||||
const rightSanitized = sanitize(triple.right)
|
||||
const right =
|
||||
typeof rightSanitized === 'undefined'
|
||||
? propConfig.default
|
||||
: rightSanitized
|
||||
|
||||
return valsAtom.setIn(
|
||||
pathToProp,
|
||||
|
|
Loading…
Reference in a new issue