diff options
author | cmal <paul@cmal.info> | 2018-04-17 11:24:03 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-04-17 15:39:33 +0200 |
commit | 236f0c840b45e0c41fcbb2fb6ee556c0fb2d4859 (patch) | |
tree | 057d08f9efb306abca87ef29ba6c9135c9d382f7 /hugolib/shortcode.go | |
parent | cd6a261242b63555ac2c3ca7a8462b874b490701 (diff) |
.Get doesn't crash on missing positional param
fixes #4619
Diffstat (limited to 'hugolib/shortcode.go')
-rw-r--r-- | hugolib/shortcode.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/hugolib/shortcode.go b/hugolib/shortcode.go index 3cf472f82..78971132b 100644 --- a/hugolib/shortcode.go +++ b/hugolib/shortcode.go @@ -86,8 +86,7 @@ func (scp *ShortcodeWithPage) Get(key interface{}) interface{} { idx := int(reflect.ValueOf(key).Int()) ln := reflect.ValueOf(scp.Params).Len() if idx > ln-1 { - helpers.DistinctErrorLog.Printf("No shortcode param at .Get %d in page %s, have params: %v", idx, scp.Page.FullFilePath(), scp.Params) - return fmt.Sprintf("error: index out of range for positional param at position %d", idx) + return "" } x = reflect.ValueOf(scp.Params).Index(idx) } |