From 4eed88e0c2eebbaf04489526dfaeab7cfb77ee98 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Thu, 13 Jul 2017 08:12:11 -0400 Subject: PLT-7092 Fixed creation of PostList with null Posts fields (#6924) --- api/channel.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'api') diff --git a/api/channel.go b/api/channel.go index c7b0630e6..2a56e7c93 100644 --- a/api/channel.go +++ b/api/channel.go @@ -602,16 +602,15 @@ func getMyChannelMembers(c *Context, w http.ResponseWriter, r *http.Request) { func getPinnedPosts(c *Context, w http.ResponseWriter, r *http.Request) { params := mux.Vars(r) channelId := params["channel_id"] - posts := &model.PostList{} if result := <-app.Srv.Store.Channel().GetPinnedPosts(channelId); result.Err != nil { c.Err = result.Err return } else { - posts = result.Data.(*model.PostList) + posts := result.Data.(*model.PostList) + w.Write([]byte(posts.ToJson())) } - w.Write([]byte(posts.ToJson())) } func addMember(c *Context, w http.ResponseWriter, r *http.Request) { -- cgit v1.2.3-1-g7c22