Skip to content

Commit

Permalink
Merge pull request #599 from motian/develop
Browse files Browse the repository at this point in the history
fix(kernel): call Server.Serve nil pointer fixed
  • Loading branch information
Matrix-X authored Jan 1, 2025
2 parents ffbdf4a + 910d17f commit 27ddb84
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/kernel/serverGuard.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ func (serverGuard *ServerGuard) Serve(request *http.Request) (response *http.Res

response, err = validatedGuard.Resolve(request)

logger.Info("Server response created:", "content", response.ContentLength)
if response != nil {
logger.Info("Server response created:", "content", response.ContentLength)
}

return response, err
}
Expand Down Expand Up @@ -434,7 +436,7 @@ func (serverGuard *ServerGuard) ParseMessage(content string, dataType string) (c
callback = &models.Callback{}

if len(content) <= 0 {
return nil, errors.New("request body is empty")
return callback, nil
}

if dataType == messages.DataTypeXML {
Expand Down

0 comments on commit 27ddb84

Please sign in to comment.