Skip to content

Commit

Permalink
send empty array instead of null (#415)
Browse files Browse the repository at this point in the history
  • Loading branch information
MashhoodIjaz committed Mar 19, 2024
1 parent d986a66 commit 12b96af
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/handlers/appsHandler.go
Expand Up @@ -83,6 +83,10 @@ func AppsHandler(responseWriter http.ResponseWriter, request *http.Request) {
}
}

if forecastleApps == nil {
forecastleApps = []forecastle.App{}
}

js, err := json.Marshal(forecastleApps)
if err != nil {
logger.Error("An error occurred while marshalling apps to json: ", err)
Expand Down

0 comments on commit 12b96af

Please sign in to comment.