Closed reddg321 closed 2 years ago
solved. changed var productNumbers = []; to var productNumbers = [0];
@reddg321 thanks for the hint. The first product with the number "0" is typically created in the initCities function. If that does not happen, the script would indeed crash. This implicit dependency is of course bad code quality and I fixed it: newProductNumber now defaults to 0 and productNumbers are not considered if there is none yet. Now the script should be more robust for example in cases when you create divisions and not use the initCities function.
corp.js crashes when trying to create a second product as products are named product-NaN