Check for nil Params in shortcode's Get

Fixes #2294
This commit is contained in:
Bjørn Erik Pedersen
2016-07-21 17:18:55 +02:00
parent 0bdc0d62d4
commit 593a546fc6
2 changed files with 13 additions and 7 deletions

View File

@@ -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
}