diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2016-07-21 17:18:55 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2016-07-21 17:22:31 +0200 |
commit | 593a546fc6b00d4a34eba3b3f5172fed2c100507 (patch) | |
tree | 09634b3b679a41fa8941adc4b2becba19c3d5456 /hugolib/shortcode.go | |
parent | 0bdc0d62d4f5d117032e4c09f2438e9df4a9c18b (diff) |
Check for nil Params in shortcode's Get
Fixes #2294
Diffstat (limited to 'hugolib/shortcode.go')
-rw-r--r-- | hugolib/shortcode.go | 3 |
1 files changed, 3 insertions, 0 deletions
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 } |