Skip to content

Commit

Permalink
nil log config panic fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bbrks committed Jul 5, 2024
1 parent 0e933e6 commit 1809faf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions rest/admin_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,13 @@ func (h *handler) handlePutDbAuditConfig() error {
return base.HTTPErrorf(http.StatusBadRequest, "couldn't update audit configuration: %s", err)
}

if config.Logging == nil {
config.Logging = &DbLoggingConfig{}
}
if config.Logging.Audit == nil {
config.Logging.Audit = &DbAuditLoggingConfig{}
}

if isReplace || body.Enabled != nil {
config.Logging.Audit.Enabled = body.Enabled
}
Expand Down

0 comments on commit 1809faf

Please sign in to comment.