From e0226c90393bc2ed7d020da0cae2c7eb5e3a2df8 Mon Sep 17 00:00:00 2001 From: James Nugent Date: Wed, 14 Sep 2016 09:48:42 +0100 Subject: [PATCH] core: Check for attrV being nil before dereference This can be an issue with unset computed fields. Fixes #8815. --- helper/schema/schema.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/helper/schema/schema.go b/helper/schema/schema.go index ca241f4ae..3e878c0a3 100644 --- a/helper/schema/schema.go +++ b/helper/schema/schema.go @@ -638,7 +638,9 @@ func (m schemaMap) diff( } for attrK, attrV := range unsupressedDiff.Attributes { - if schema.DiffSuppressFunc != nil && schema.DiffSuppressFunc(attrK, attrV.Old, attrV.New, d) { + if schema.DiffSuppressFunc != nil && + attrV != nil && + schema.DiffSuppressFunc(attrK, attrV.Old, attrV.New, d) { continue }