summaryrefslogtreecommitdiffstats
path: root/model/post_list.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/post_list.go')
-rw-r--r--model/post_list.go11
1 files changed, 3 insertions, 8 deletions
diff --git a/model/post_list.go b/model/post_list.go
index 09cddfdcf..27c22e7bd 100644
--- a/model/post_list.go
+++ b/model/post_list.go
@@ -132,12 +132,7 @@ func (o *PostList) IsChannelId(channelId string) bool {
}
func PostListFromJson(data io.Reader) *PostList {
- decoder := json.NewDecoder(data)
- var o PostList
- err := decoder.Decode(&o)
- if err == nil {
- return &o
- } else {
- return nil
- }
+ var o *PostList
+ json.NewDecoder(data).Decode(&o)
+ return o
}