From 3819335090515c7dc96d1a84573639681c8c9cc9 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Wed, 28 Dec 2022 15:01:45 -0800 Subject: [PATCH] Return error when data not found in logo upload API --- controllers/admin/config.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/controllers/admin/config.go b/controllers/admin/config.go index 84b98e78c..78077a238 100644 --- a/controllers/admin/config.go +++ b/controllers/admin/config.go @@ -227,7 +227,12 @@ func SetLogo(w http.ResponseWriter, r *http.Request) { return } - bytes, extension, err := utils.DecodeBase64Image(configValue.Value.(string)) + value, ok := configValue.Value.(string) + if !ok { + controllers.WriteSimpleResponse(w, false, "unable to find image data") + return + } + bytes, extension, err := utils.DecodeBase64Image(value) if err != nil { controllers.WriteSimpleResponse(w, false, err.Error()) return