Skip to content

Commit

Permalink
Merge pull request #31 from dreamblack86/nil-pointer-exception
Browse files Browse the repository at this point in the history
Avoid null pointer exception for string interpolation
  • Loading branch information
mr-karan authored Jul 8, 2021
2 parents 3508c02 + ea7dc6b commit 45ea348
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ type Handler struct {
func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
code, msg, data, et, err := h.HandleRequest(h.App, w, r)
if et != "" {
errLog.Printf("Error while processing request: %s", err)
if err != nil {
errLog.Printf("Error while processing request: %s", err)
}
sendErrorEnvelope(w, code, msg, data, et)
} else {
sendEnvelope(w, code, msg, data)
Expand Down

0 comments on commit 45ea348

Please sign in to comment.