From 8b95cab94ce3426681f32c6f07620a3c7d2f572a Mon Sep 17 00:00:00 2001 From: bep Date: Sun, 1 Feb 2015 22:29:46 +0100 Subject: [PATCH] Avoid panic on unknown markup Fixes #863 --- hugolib/handler_meta.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hugolib/handler_meta.go b/hugolib/handler_meta.go index 1f65f9a60..bdab3a019 100644 --- a/hugolib/handler_meta.go +++ b/hugolib/handler_meta.go @@ -16,6 +16,7 @@ package hugolib import ( "errors" + "fmt" "github.com/spf13/hugo/source" ) @@ -66,6 +67,12 @@ func (mh *MetaHandle) Convert(i interface{}, s *Site, results HandleResults) { results <- HandledResult{err: errors.New("file resulted in a nil page")} return } + + if h == nil { + results <- HandledResult{err: fmt.Errorf("No handler found for page '%s'. Verify the markup is supported by Hugo.", p.FullFilePath())} + return + } + results <- h.PageConvert(p, s.Tmpl) p.setSummary() p.analyzePage()