From 2129361dd0306612e8ecc89226a216b870fad381 Mon Sep 17 00:00:00 2001 From: Rohan Singh Date: Sat, 15 Jan 2022 14:32:04 -0500 Subject: [PATCH] schema: Fix field copying (#122) `range` provides a copy so taking an address is invalid. --- schema/schema.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schema/schema.go b/schema/schema.go index 5661c44c3b..8ee99f45c6 100644 --- a/schema/schema.go +++ b/schema/schema.go @@ -116,7 +116,7 @@ func FromStarlark( } for i, schemaField := range schema.Fields { - schema.fieldByID[schemaField.ID] = &schemaField + schema.fieldByID[schemaField.ID] = &schema.Fields[i] if schemaField.Handler != "" { handlerValue, found := globals[schemaField.Handler] if !found {