Skip to content

Commit

Permalink
Added validation for interface type for null schema
Browse files Browse the repository at this point in the history
  • Loading branch information
serejja committed May 15, 2015
1 parent f9c9dd4 commit 6f91eaf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,8 @@ func (*NullSchema) Prop(key string) (string, bool) {
func (*NullSchema) Validate(v reflect.Value) bool {
// Check if the value is something that can be null
switch v.Kind() {
case reflect.Interface:
return v.IsNil()
case reflect.Array:
return v.Cap() == 0
case reflect.Slice:
Expand Down

0 comments on commit 6f91eaf

Please sign in to comment.