From f67aea54d96e31fbc0b42f8684baa38f8f8ddba4 Mon Sep 17 00:00:00 2001 From: Justin Santa Barbara Date: Wed, 20 Jul 2016 19:55:59 -0400 Subject: [PATCH] Guard against zero values when comparing values This seems to happen when comparing map values --- upup/pkg/fi/changes.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/upup/pkg/fi/changes.go b/upup/pkg/fi/changes.go index cc840d6f81..f7e8c913b5 100644 --- a/upup/pkg/fi/changes.go +++ b/upup/pkg/fi/changes.go @@ -72,6 +72,10 @@ func BuildChanges(a, e, changes interface{}) bool { // equalFieldValues implements our equality checking, with special cases for resources and tasks func equalFieldValues(a, e reflect.Value) bool { + if !a.IsValid() || !e.IsValid() { + return a.IsValid() == e.IsValid() + } + if a.Kind() == reflect.Map { return equalMapValues(a, e) }