Fix panic on DB error (#15310)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
6a50106cd9
Коммит
e6c1d5f75b
@@ -2644,7 +2644,7 @@ func (a *App) createInitialSidebarCategories(userId, teamId string) *model.AppEr
|
||||
func (a *App) GetSidebarCategories(userId, teamId string) (*model.OrderedSidebarCategories, *model.AppError) {
|
||||
categories, err := a.Srv().Store.Channel().GetSidebarCategories(userId, teamId)
|
||||
|
||||
if len(categories.Categories) == 0 && err == nil {
|
||||
if err == nil && len(categories.Categories) == 0 {
|
||||
// A user must always have categories, so migration must not have happened yet, and we should run it ourselves
|
||||
nErr := a.createInitialSidebarCategories(userId, teamId)
|
||||
if nErr != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user