From deb68938fa9631d6cd78fc52a430a56f891ef764 Mon Sep 17 00:00:00 2001 From: Denis Arh Date: Thu, 11 Feb 2021 08:28:51 +0100 Subject: [PATCH] Fix panic on unintialized RecordValueErrorSet --- compose/types/validated.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/compose/types/validated.go b/compose/types/validated.go index 83c06703b..fdc691996 100644 --- a/compose/types/validated.go +++ b/compose/types/validated.go @@ -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) {