From 098acafab1b4dda0514bff36b416314db548a2c1 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Sun, 16 Oct 2022 02:07:25 -0400 Subject: [PATCH] No segfaulty --- analyzer/enum-section.go | 4 +++- tests/analyzer/enumSection/main.arf | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/analyzer/enum-section.go b/analyzer/enum-section.go index 82a4580..f13f195 100644 --- a/analyzer/enum-section.go +++ b/analyzer/enum-section.go @@ -35,7 +35,9 @@ func (section EnumSection) ToString (indent int) (output string) { output += section.permission.ToString() + " " output += section.where.ToString() output += "\n" - output += section.argument.ToString(indent + 1) + if section.argument != nil { + output += section.argument.ToString(indent + 1) + } output += section.what.ToString(indent + 1) for _, member := range section.members { output += member.ToString(indent + 1) diff --git a/tests/analyzer/enumSection/main.arf b/tests/analyzer/enumSection/main.arf index 3a7df5a..4bc4678 100644 --- a/tests/analyzer/enumSection/main.arf +++ b/tests/analyzer/enumSection/main.arf @@ -21,3 +21,4 @@ enum ro cNamedColor:bColor enum ro dFromFarAway:typeSection.dInheritFromOther - bird - bread 4 +