From 593a546fc6b00d4a34eba3b3f5172fed2c100507 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 21 Jul 2016 17:18:55 +0200 Subject: Check for nil Params in shortcode's Get Fixes #2294 --- hugolib/shortcode.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'hugolib/shortcode.go') diff --git a/hugolib/shortcode.go b/hugolib/shortcode.go index 8ea09feda..2de00fa90 100644 --- a/hugolib/shortcode.go +++ b/hugolib/shortcode.go @@ -66,6 +66,9 @@ func (scp *ShortcodeWithPage) Scratch() *Scratch { // Get is a convenience method to look up shortcode parameters by its key. func (scp *ShortcodeWithPage) Get(key interface{}) interface{} { + if scp.Params == nil { + return nil + } if reflect.ValueOf(scp.Params).Len() == 0 { return nil } -- cgit v1.2.3