summaryrefslogtreecommitdiffstats
path: root/api/channel.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-03-03 12:25:32 -0500
committerChristopher Speller <crspeller@gmail.com>2017-03-03 12:25:32 -0500
commite739a91c94049aa62cfe76b9c6686fb18184232b (patch)
tree37d7f65f9f3fd59daea9d80473fd595eacd8c0f9 /api/channel.go
parent2e911b77c3386833f8f0cea82c7b6b3e5583a08e (diff)
downloadchat-e739a91c94049aa62cfe76b9c6686fb18184232b.tar.gz
chat-e739a91c94049aa62cfe76b9c6686fb18184232b.tar.bz2
chat-e739a91c94049aa62cfe76b9c6686fb18184232b.zip
Fix JS error when receiving reply during channel switch (#5582)
Diffstat (limited to 'api/channel.go')
-rw-r--r--api/channel.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/api/channel.go b/api/channel.go
index 2604cc5ce..9c11f073e 100644
--- a/api/channel.go
+++ b/api/channel.go
@@ -772,6 +772,10 @@ func autocompleteChannels(c *Context, w http.ResponseWriter, r *http.Request) {
func viewChannel(c *Context, w http.ResponseWriter, r *http.Request) {
view := model.ChannelViewFromJson(r.Body)
+ if view == nil {
+ c.SetInvalidParam("viewChannel", "channel_view")
+ return
+ }
if err := app.ViewChannel(view, c.Session.UserId, !c.Session.IsMobileApp()); err != nil {
c.Err = err