Skip to content

Commit

Permalink
js: Valid now checks for zero value
Browse files Browse the repository at this point in the history
  • Loading branch information
Denys Smirnov committed Oct 12, 2018
1 parent baf54e9 commit 02cd180
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/js.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (v Value) IsUndefined() bool {

// Valid checks if object is defined and not null.
func (v Value) Valid() bool {
return !v.IsNull() && !v.IsUndefined()
return !v.isZero() && !v.IsNull() && !v.IsUndefined()
}

// Get returns the JS property by name.
Expand Down

0 comments on commit 02cd180

Please sign in to comment.