From 62c8d4723a23a2b8a782f758589420b0c3207071 Mon Sep 17 00:00:00 2001 From: Danny Date: Tue, 16 Sep 2025 19:00:49 +0200 Subject: [PATCH] Don't make data object an empty array on error --- internal/api/api.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/api/api.go b/internal/api/api.go index 8e22105..f449138 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -45,7 +45,6 @@ func NewRequest(method string, path string, queryParameters []string, body []byt isExtensionsLiveEndpoint := false // https://github.com/twitchdev/twitch-cli/issues/157 - data.Data = make([]interface{}, 0) client, err := GetClientInformation() if err != nil { return fmt.Errorf("Error fetching client information: %v", err.Error()) @@ -186,7 +185,7 @@ func NewRequest(method string, path string, queryParameters []string, body []byt runCounter++ } - if data.Data == nil { + if data.Data == nil && data.Error == "" { data.Data = make([]interface{}, 0) } // handle json marshalling better; returns empty slice vs. null