Skip to content

Commit

Permalink
Check if mock is not nil before writing response
Browse files Browse the repository at this point in the history
  • Loading branch information
martinsirbe authored and daveshanley committed Apr 27, 2024
1 parent a0fc15e commit bd63eae
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion daemon/handle_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,12 @@ func (ws *WiretapService) handleMockRequest(

// if the mock is empty
request.HttpResponseWriter.WriteHeader(mockStatus)
if mock == nil {
return
}

_, errs := request.HttpResponseWriter.Write(mock)
if errs != nil {
panic(errs)
}
return
}

0 comments on commit bd63eae

Please sign in to comment.