1 00:00:00,560 --> 00:00:02,790 And we have two types of problems in this case. 2 00:00:02,790 --> 00:00:03,840 First we have another. 3 00:00:04,110 --> 00:00:08,640 So our application crashed just because we were using our flattened function. 4 00:00:08,760 --> 00:00:13,680 And then of course within the flattened function we assumed that there was gonna be an image. 5 00:00:13,710 --> 00:00:18,600 And second thing once we were going to fix this error then of course we're still gonna have an issue 6 00:00:18,600 --> 00:00:24,930 where we're going to show the product with any type of data and then just to show you where this error 7 00:00:24,930 --> 00:00:25,770 comes from. 8 00:00:25,860 --> 00:00:32,250 If we're gonna go with local host then remember it was 13 thirty seven and we're going to look for our 9 00:00:32,250 --> 00:00:32,990 product. 10 00:00:33,120 --> 00:00:40,440 You're going to see that the last product as the idea for so stroppy did automatically have a I.D. but 11 00:00:40,790 --> 00:00:41,650 that is now. 12 00:00:41,660 --> 00:00:44,680 Price is now description has no feature it is no. 13 00:00:44,770 --> 00:00:50,130 And also the image is not an image is causing this initial issue. 14 00:00:50,130 --> 00:00:50,880 Why. 15 00:00:50,880 --> 00:00:58,050 Well because as we're looping over our items we say get item then item is going to have the property 16 00:00:58,050 --> 00:01:00,510 of image and then it's going to be an object. 17 00:01:00,510 --> 00:01:02,780 Now is this an object or not. 18 00:01:02,790 --> 00:01:04,830 Well it's not an object because it is not. 19 00:01:05,220 --> 00:01:06,950 That's the reason why we get right away. 20 00:01:06,960 --> 00:01:14,610 A big factor in this case the fix is somewhat simple where we can check if the image property is true. 21 00:01:14,880 --> 00:01:20,130 So if this is true if it's not no Then get me your property. 22 00:01:20,130 --> 00:01:25,420 Otherwise just return a note and at least we're going to fix this initial bug. 23 00:01:25,440 --> 00:01:28,430 So in this case I'm going to go with the item image. 24 00:01:28,590 --> 00:01:36,900 So would say if the property is true or true three then just get me the euro if it is not a case well 25 00:01:36,900 --> 00:01:38,500 then just return a no. 26 00:01:38,940 --> 00:01:42,440 So this is the initial change we need to do in a flattened product. 27 00:01:42,540 --> 00:01:45,520 And then of course like I said the products are there. 28 00:01:45,570 --> 00:01:47,220 So our app is not crashing. 29 00:01:47,580 --> 00:01:53,190 However is this the product you would want to display or you would first want to have some kind of double 30 00:01:53,190 --> 00:01:53,860 checking. 31 00:01:54,000 --> 00:01:57,670 And maybe it is going to show up even in the console if there is an error. 32 00:01:57,750 --> 00:02:03,410 And second you probably want to show some kind of default info instead of just showing the blank product.