Skip to content

Commit

Permalink
[MM-60278] app/config.go: add a nil check for a required field (matte…
Browse files Browse the repository at this point in the history
…rmost#28064)

* app/config.go: add a nil check for a required field

* Apply suggestions from code review

Co-authored-by: Ben Schumacher <[email protected]>

---------

Co-authored-by: Ben Schumacher <[email protected]>
Co-authored-by: Mattermost Build <[email protected]>
  • Loading branch information
3 people authored Sep 16, 2024
1 parent 73b14b4 commit c7ae41b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/channels/app/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ func (a *App) HandleMessageExportConfig(cfg *model.Config, appCfg *model.Config)
// appropriate value. The rewriting occurs here to ensure it doesn't affect values written to the config file
// directly and not through the System Console UI.
if *cfg.MessageExportSettings.EnableExport != *appCfg.MessageExportSettings.EnableExport {
if *cfg.MessageExportSettings.EnableExport && *cfg.MessageExportSettings.ExportFromTimestamp == int64(0) {
if *cfg.MessageExportSettings.EnableExport && model.SafeDereference(cfg.MessageExportSettings.ExportFromTimestamp) == int64(0) {
// When the feature is toggled on, use the current timestamp as the start time for future exports.
cfg.MessageExportSettings.ExportFromTimestamp = model.NewPointer(model.GetMillis())
} else if !*cfg.MessageExportSettings.EnableExport {
Expand Down

0 comments on commit c7ae41b

Please sign in to comment.