From c7ae41b6359eb4a9b16a2713ec06b3bcf28c49ba Mon Sep 17 00:00:00 2001 From: Ibrahim Serdar Acikgoz Date: Mon, 16 Sep 2024 15:24:01 +0200 Subject: [PATCH] [MM-60278] app/config.go: add a nil check for a required field (#28064) * app/config.go: add a nil check for a required field * Apply suggestions from code review Co-authored-by: Ben Schumacher --------- Co-authored-by: Ben Schumacher Co-authored-by: Mattermost Build --- server/channels/app/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/channels/app/config.go b/server/channels/app/config.go index 07ea00cf56..63382e29a1 100644 --- a/server/channels/app/config.go +++ b/server/channels/app/config.go @@ -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 {