hugolib: Fix potential server panic with drafts/future enabled
hugolib: Fix potential server panic with drafts/future enabled

Fixes #4965

gohugoio/hugo,gohugoio/hugo,mdhender/hugo,fedelibre/hugo,mdhender/hugo,fedelibre/hugo,mdhender/hugo,anthonyfok/hugo,fedelibre/hugo,anthonyfok/hugo,gohugoio/hugo,fedelibre/hugo,anthonyfok/hugo,mdhender/hugo