Skip to content

Commit

Permalink
prevent encoded nil in endpoint response (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickcurie authored Jul 17, 2024
1 parent 81fbd24 commit a7b7f43
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions pkg/turndown/turndownendpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,7 @@ func (te *TurndownEndpoints) HandleStartSchedule(w http.ResponseWriter, r *http.
if r.Method == http.MethodGet {
schedule := te.scheduler.GetSchedule()

marshaled, err := json.Marshal(schedule)
if err != nil {
protocol.WriteError(w, protocol.InternalServerError(fmt.Sprintf("Failed to marshal result: %s", err)))
return
}

protocol.WriteData(w, marshaled)
protocol.WriteData(w, schedule)
return
}

Expand Down

0 comments on commit a7b7f43

Please sign in to comment.