Skip to content

Commit

Permalink
fix: MM-61260: handled errors to fix linting (mattermost#29340)
Browse files Browse the repository at this point in the history
Co-authored-by: Ibrahim Serdar Acikgoz <[email protected]>
  • Loading branch information
srisri332 and isacikgoz authored Nov 29, 2024
1 parent ff1ffc5 commit 961fc6b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
1 change: 0 additions & 1 deletion server/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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|\
Expand Down
16 changes: 12 additions & 4 deletions server/channels/app/imports/import_validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}

Expand Down Expand Up @@ -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
}
}
}

Expand Down

0 comments on commit 961fc6b

Please sign in to comment.