Skip to content

Commit

Permalink
fix panic with nil pointer
Browse files Browse the repository at this point in the history
Panic will be occurred when try to send a comment while not connecting to any live.
  • Loading branch information
diginatu committed Jan 5, 2017
1 parent b24e962 commit f05247e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plugin_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ func processPluginMessage(cv *CommentViewer, m *Message) error {
cv.Disconnect()

case CommQueryBroadSendComment:
if cv.Cmm == nil {
return nicolive.MakeError(nicolive.ErrOther, "not connected to live")
}
var ct CtQueryBroadSendComment
if err := json.Unmarshal(m.Content, &ct); err != nil {
return nicolive.MakeError(nicolive.ErrOther, "JSON error in the content : "+err.Error())
Expand Down

0 comments on commit f05247e

Please sign in to comment.