1π
β
It is possible that product.productID is null and you are trying to access brand from null which is causing error.
To avoid error, you can use optional chaining
product.productID?.brand
Source:stackexchange.com