Skip to content

variable existence not verified before usage  #124

@speedupmate

Description

@speedupmate

<text args="(currentBillingAddress().street).join(', ')"></text><br/>

hitting this with address not having a street value will generate a error

knockout.js:3381 Uncaught TypeError: Unable to process binding "text: function(){return (currentBillingAddress().street).join(', ') }"
Message: Cannot read properties of undefined (reading 'join')
    at text (eval at createBindingsStringEvaluator (knockout.js:2982:16), <anonymous>:3:97)
    at update (knockout.js:4659:42)
    at ko.dependentObservable.disposeWhenNodeIsRemoved (knockout.js:3373:33)
    at Function.evaluateImmediate_CallReadThenEndDependencyDetection (knockout.js:2173:103)
    at Function.evaluateImmediate_CallReadWithDependencyDetection (knockout.js:2140:29)
    at Function.evaluateImmediate (knockout.js:2101:28)
    at ko.computed.ko.dependentObservable (knockout.js:1954:28)
    at knockout.js:3371:28
    at Object.arrayForEach (knockout.js:159:17)
    at applyBindingsToNodeInternal (knockout.js:3343:22)
    at applyBindingsToNodeAndDescendantsInternal (knockout.js:3223:37)
    at applyBindingsToDescendantsInternal (knockout.js:3205:13)
    at applyBindingsToNodeAndDescendantsInternal (knockout.js:3232:13)
    at applyBindingsToDescendantsInternal (knockout.js:3205:13)
    at ko.applyBindingsToDescendants (knockout.js:3421:13)
    at ko.computed.disposeWhenNodeIsRemoved (knockout.js:4397:28)

also refer to
#101
magento/magento2#33826

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions