And we have two types of problems in this case.
First we have another.
So our application crashed just because we were using our flattened function.
And then of course within the flattened function we assumed that there was gonna be an image.
And second thing once we were going to fix this error then of course we're still gonna have an issue
where we're going to show the product with any type of data and then just to show you where this error
comes from.
If we're gonna go with local host then remember it was 13 thirty seven and we're going to look for our
product.
You're going to see that the last product as the idea for so stroppy did automatically have a I.D. but
that is now.
Price is now description has no feature it is no.
And also the image is not an image is causing this initial issue.
Why.
Well because as we're looping over our items we say get item then item is going to have the property
of image and then it's going to be an object.
Now is this an object or not.
Well it's not an object because it is not.
That's the reason why we get right away.
A big factor in this case the fix is somewhat simple where we can check if the image property is true.
So if this is true if it's not no Then get me your property.
Otherwise just return a note and at least we're going to fix this initial bug.
So in this case I'm going to go with the item image.
So would say if the property is true or true three then just get me the euro if it is not a case well
then just return a no.
So this is the initial change we need to do in a flattened product.
And then of course like I said the products are there.
So our app is not crashing.
However is this the product you would want to display or you would first want to have some kind of double
checking.
And maybe it is going to show up even in the console if there is an error.
And second you probably want to show some kind of default info instead of just showing the blank product.