diff options
author | Cameron Moore <moorereason@gmail.com> | 2017-05-17 21:29:35 -0500 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-05-18 21:54:42 +0300 |
commit | 38661c17bb8c31c9f31ee18f8eba5e3bfddd5574 (patch) | |
tree | c5a2275b82cbc85b52ec9565464a272ad5c49dc4 /tpl/collections/collections.go | |
parent | 42fbded1055d0f49d8c00cf7344edf2017b08ac9 (diff) |
tpl/collections: Log an error on unsupported types in IsSet
Unsupported types are currently silently ignored by IsSet. An earlier
attempt was made to solve the issue by returning an error. That attempt
was reverted since it broke some existing themes.
So instead, we'll log an error. Hopefully, people will stop using IsSet
in this way, and we can eventually return an error outright.
Updates #3092
Diffstat (limited to 'tpl/collections/collections.go')
-rw-r--r-- | tpl/collections/collections.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tpl/collections/collections.go b/tpl/collections/collections.go index 081515ae5..f2816e4f1 100644 --- a/tpl/collections/collections.go +++ b/tpl/collections/collections.go @@ -370,6 +370,8 @@ func (ns *Namespace) IsSet(a interface{}, key interface{}) (bool, error) { if kv.Type() == av.Type().Key() { return av.MapIndex(kv).IsValid(), nil } + default: + ns.deps.Log.ERROR.Printf("calling IsSet with unsupported type %T will always return false", a) } return false, nil |