File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -577,31 +577,32 @@ func (val Value) IsNull() bool {
577577// IsFullyNull returns true if the Value is null or if the Value is an
578578// aggregate that consists of only fully null elements and attributes.
579579func (val Value ) IsFullyNull () bool {
580+ if val .IsNull () {
581+ return true
582+ }
583+
580584 switch val .Type ().(type ) {
581585 case primitive :
582- return val .IsNull ()
586+ return false // already checked IsNull() and not an aggregate
587+
583588 case List , Set , Tuple :
584- sliceVal , ok := val .value .([]Value )
585- if ! ok {
586- return true
587- }
589+ sliceVal := val .value .([]Value )
588590 for _ , v := range sliceVal {
589591 if ! v .IsFullyNull () {
590592 return false
591593 }
592594 }
593595 return true
596+
594597 case Map , Object :
595- mapVal , ok := val .value .(map [string ]Value )
596- if ! ok {
597- return true
598- }
598+ mapVal := val .value .(map [string ]Value )
599599 for _ , v := range mapVal {
600600 if ! v .IsFullyNull () {
601601 return false
602602 }
603603 }
604604 return true
605+
605606 default :
606607 panic (fmt .Sprintf ("unknown type %T" , val .Type ()))
607608 }
You can’t perform that action at this time.
0 commit comments