summaryrefslogtreecommitdiffstats
path: root/store
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2017-07-13 08:12:11 -0400
committerJoram Wilander <jwawilander@gmail.com>2017-07-13 08:12:11 -0400
commit4eed88e0c2eebbaf04489526dfaeab7cfb77ee98 (patch)
tree2e1ba735fc9cf00cedb70d361177efcfd01d7333 /store
parent9a654d7b274422789e5d73898244964db7083e9d (diff)
downloadchat-4eed88e0c2eebbaf04489526dfaeab7cfb77ee98.tar.gz
chat-4eed88e0c2eebbaf04489526dfaeab7cfb77ee98.tar.bz2
chat-4eed88e0c2eebbaf04489526dfaeab7cfb77ee98.zip
PLT-7092 Fixed creation of PostList with null Posts fields (#6924)
Diffstat (limited to 'store')
-rw-r--r--store/sql_channel_store.go2
-rw-r--r--store/sql_post_store.go3
2 files changed, 2 insertions, 3 deletions
diff --git a/store/sql_channel_store.go b/store/sql_channel_store.go
index c009d64d3..db9c2c1f4 100644
--- a/store/sql_channel_store.go
+++ b/store/sql_channel_store.go
@@ -361,7 +361,7 @@ func (s SqlChannelStore) GetPinnedPosts(channelId string) StoreChannel {
go func() {
result := StoreResult{}
- pl := &model.PostList{}
+ pl := model.NewPostList()
var posts []*model.Post
if _, err := s.GetReplica().Select(&posts, "SELECT * FROM Posts WHERE IsPinned = true AND ChannelId = :ChannelId AND DeleteAt = 0 ORDER BY CreateAt ASC", map[string]interface{}{"ChannelId": channelId}); err != nil {
diff --git a/store/sql_post_store.go b/store/sql_post_store.go
index 16142681c..e89b5e042 100644
--- a/store/sql_post_store.go
+++ b/store/sql_post_store.go
@@ -910,8 +910,7 @@ func (s SqlPostStore) Search(teamId string, userId string, params *model.SearchP
result := StoreResult{}
if !*utils.Cfg.ServiceSettings.EnablePostSearch {
- list := &model.PostList{}
- list.MakeNonNil()
+ list := model.NewPostList()
result.Data = list
result.Err = model.NewLocAppError("SqlPostStore.Search", "store.sql_post.search.disabled", nil, fmt.Sprintf("teamId=%v userId=%v params=%v", teamId, userId, params.ToJson()))