logical/framework: handle nil duration value. Fixes #408

This commit is contained in:
Armon Dadgar
2015-07-08 16:55:52 -06:00
parent b8754e740c
commit 9515bf32de
2 changed files with 13 additions and 0 deletions

View File

@@ -135,6 +135,17 @@ func TestFieldDataGet(t *testing.T) {
"foo",
42,
},
"duration type, nil value": {
map[string]*FieldSchema{
"foo": &FieldSchema{Type: TypeDurationSecond},
},
map[string]interface{}{
"foo": nil,
},
"foo",
0,
},
}
for name, tc := range cases {