lunarphp / lunar

An open-source package that brings the power of modern headless e-commerce functionality to Laravel.
https://lunarphp.io
MIT License
2.69k stars 352 forks source link

Detail page shouldn't throw error just because image is missing #2014

Open blursolo opened 1 day ago

blursolo commented 1 day ago

Expected Behaviour:

Detail-Page should be shown without the image.

Actual Behaviour:

An error is thrown: App\Livewire\ProductPage::getImageProperty(): Return value must be of type Spatie\MediaLibrary\MediaCollections\Models\Media, null returned

Steps To Reproduce:

Create a product without uploading an image to the Media tab, then visit the product detail page in the frontend.

glennjacobs commented 1 day ago

What frontend are you referring to? It sounds like maybe this should be an issue on the Livewire starter kit?

blursolo commented 1 day ago

You're right, my mistake.