From 8562b8efdf3756270c431d7cd0c061c7b312c504 Mon Sep 17 00:00:00 2001 From: Matteo Nardelli Date: Wed, 8 May 2024 12:32:42 +0000 Subject: [PATCH] minor: fix potential null pointer exception --- internal/fc/function_composition.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/fc/function_composition.go b/internal/fc/function_composition.go index ba1b8bf7..ecaa07aa 100644 --- a/internal/fc/function_composition.go +++ b/internal/fc/function_composition.go @@ -288,7 +288,7 @@ func (fc *FunctionComposition) Exists() bool { if !found { // cache miss f, err := getFCFromEtcd(fc.Name) - if err.Error() == fmt.Sprintf("failed to retrieve value for key %s", getEtcdKey(fc.Name)) { + if err != nil && err.Error() == fmt.Sprintf("failed to retrieve value for key %s", getEtcdKey(fc.Name)) { return false } else if err != nil { log.Error(err.Error())