Make sure vars-to-json does not crash if value is nil
This commit is contained in:
@@ -284,6 +284,10 @@ func (t *Vars) Set(k string, v interface{}) (err error) {
|
||||
func (t Vars) MarshalJSON() ([]byte, error) {
|
||||
aux := make(map[string]*typedValueWrap)
|
||||
for k, v := range t.value {
|
||||
if v == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
aux[k] = &typedValueWrap{Type: v.Type()}
|
||||
|
||||
if _, is := v.(json.Marshaler); is {
|
||||
|
||||
Reference in New Issue
Block a user