lorenzodejong / next-sanity-image

Utility for using responsive images hosted on the Sanity.io CDN with the Next.js image component.
MIT License
149 stars 20 forks source link

Need a solution when the image object is empty #12

Closed giacomoalonzi closed 3 years ago

giacomoalonzi commented 3 years ago

Hello, thanks for your work, but I noticed when the "image" object is empty javascript crashes. Eg. I have a Hero component that it should have or not the image. How can I handle it? Thanks.

lorenzodejong commented 3 years ago

I've just released version 3.1.4 which should fix this issue, the image parameter can now be set to null which in turn sets the return value of the hook to null.