Fix cleanup threads to properly handle not found errors (#16797)

Automatic Merge
Этот коммит содержится в:
Daniel Espino García
2021-02-01 15:52:27 +01:00
коммит произвёл GitHub
родитель ff970e080b
Коммит 745d61f388

Просмотреть файл

@@ -2106,7 +2106,8 @@ func (s *SqlPostStore) cleanupThreads(postId, rootId, userId string, permanent b
if rootId != "" {
thread, err := s.Thread().Get(rootId)
if err != nil {
if err != sql.ErrNoRows {
var nfErr *store.ErrNotFound
if !errors.As(err, &nfErr) {
return errors.Wrap(err, "failed to get a thread")
}
}