Add proper error message when receiving nil in Resource transformation
Add proper error message when receiving nil in Resource transformation

Closes #6128

gohugoio/hugo,anthonyfok/hugo,anthonyfok/hugo,gohugoio/hugo,gohugoio/hugo,anthonyfok/hugo