Nil is also considered empty

pull/150/head
obscuren 11 years ago
parent 06ea7fc830
commit f2a1260294
  1. 2
      ethutil/value.go

@ -150,7 +150,7 @@ func (val *Value) IsStr() bool {
}
func (val *Value) IsEmpty() bool {
return (val.IsSlice() || val.IsStr()) && val.Len() == 0
return val.Val == nil || ((val.IsSlice() || val.IsStr()) && val.Len() == 0)
}
// Threat the value as a slice

Loading…
Cancel
Save