diff --git a/store/sqlstore/channel_store_categories.go b/store/sqlstore/channel_store_categories.go index 94f0fea0a2..82d63779cb 100644 --- a/store/sqlstore/channel_store_categories.go +++ b/store/sqlstore/channel_store_categories.go @@ -396,6 +396,8 @@ func (s SqlChannelStore) completePopulatingCategoryChannelsT(db dbSelecter, cate sq.Eq{"Channels.Type": []model.ChannelType{model.ChannelTypeOpen, model.ChannelTypePrivate}}, sq.Eq{"Channels.TeamId": category.TeamId}, } + } else { + return nil, fmt.Errorf("invalid category type: %q", category.Type) } // A subquery that is true if the channel does not have a SidebarChannel entry for the current user on the current team