Skip to content

[BUG] Faulty if statement on this.data.house_number #60

@iwanvanzijderveld

Description

@iwanvanzijderveld

The if statement to check if postcode and house_number are filled in appears to be faulty.

I get the following error in vendor/tig/postcode-magento2/view/base/web/js/postcode-handler/postcode-nl.js

jQuery.Deferred exception: this.data.house_number.match(...) is null

The if statement determines if the postcode and house_number are a string, but the string could still be empty.
When running the following regex expression, the result of match would be null so you get an error when selecting the first element in the array.

this.data.house_number.match(/^\d+/)[0])

Screenshots
image
image

  • Magento version: 2.4.5-p9
  • PHP version: [8.1]

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