3
0

Fix panic on unintialized RecordValueErrorSet

This commit is contained in:
Denis Arh 2021-02-11 08:28:51 +01:00
parent 2d55a2a869
commit deb68938fa

View File

@ -30,7 +30,12 @@ func (v *RecordValueErrorSet) IsValid() bool {
}
func (v *RecordValueErrorSet) Error() string {
return fmt.Sprintf("%d issue(s) found", len(v.Set))
var no = 0
if v != nil {
no = len(v.Set)
}
return fmt.Sprintf("%d issue(s) found", no)
}
func (v RecordValueErrorSet) MarshalJSON() ([]byte, error) {