Skip to content

Uncaught TypeError: Cannot read property 'setSelected' of undefined at HTMLFormElement.<anonymous> (stockables_fe.js:17) #15

Description

@sakiss

https://breakdesigns.net/support/tickets/stockable-custom-fields/Ticket/8318-cannot-read-property-setselected-of-undefined

The StockableObj[i] is undefined some times.
*Check why

If you cannot find why, fix it in the js code level

StockableObj[i].setSelected();
StockableObj[i].handleOutOfStock();

becomes:

if (typeof StockableObj[i] != "undefined") {
  StockableObj[i].setSelected();
  StockableObj[i].handleOutOfStock();
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions