diff --git a/server/.golangci.yml b/server/.golangci.yml index 9827d6a29da..3d17025592f 100644 --- a/server/.golangci.yml +++ b/server/.golangci.yml @@ -91,7 +91,6 @@ issues: channels/app/file_test.go|\ channels/app/helper_test.go|\ channels/app/import_functions.go|\ - channels/app/imports/import_validators.go|\ channels/app/integration_action.go|\ channels/app/job_test.go|\ channels/app/migrations.go|\ diff --git a/server/channels/app/imports/import_validators.go b/server/channels/app/imports/import_validators.go index faff856c196..40748ff0af0 100644 --- a/server/channels/app/imports/import_validators.go +++ b/server/channels/app/imports/import_validators.go @@ -501,14 +501,18 @@ func ValidatePostImportData(data *PostImportData, maxPostSize int) *model.AppErr if data.Reactions != nil { for _, reaction := range *data.Reactions { reaction := reaction - ValidateReactionImportData(&reaction, *data.CreateAt) + if err := ValidateReactionImportData(&reaction, *data.CreateAt); err != nil { + return err + } } } if data.Replies != nil { for _, reply := range *data.Replies { reply := reply - ValidateReplyImportData(&reply, *data.CreateAt, maxPostSize) + if err := ValidateReplyImportData(&reply, *data.CreateAt, maxPostSize); err != nil { + return err + } } } @@ -617,14 +621,18 @@ func ValidateDirectPostImportData(data *DirectPostImportData, maxPostSize int) * if data.Reactions != nil { for _, reaction := range *data.Reactions { reaction := reaction - ValidateReactionImportData(&reaction, *data.CreateAt) + if err := ValidateReactionImportData(&reaction, *data.CreateAt); err != nil { + return err + } } } if data.Replies != nil { for _, reply := range *data.Replies { reply := reply - ValidateReplyImportData(&reply, *data.CreateAt, maxPostSize) + if err := ValidateReplyImportData(&reply, *data.CreateAt, maxPostSize); err != nil { + return err + } } }