Skip to content

Commit

Permalink
Fixed nil pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTipo01 committed Sep 14, 2021
1 parent 615dd66 commit 1bb9770
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,15 +356,15 @@ var (
wordclouds.Colors([]color.Color{color.RGBA{R: 247, G: 144, B: 30, A: 255}, color.RGBA{R: 194, G: 69, B: 39, A: 255}, color.RGBA{R: 38, G: 103, B: 118, A: 255}, color.RGBA{R: 173, G: 210, B: 224, A: 255}}),
)

var imgPng *bytes.Buffer
var imgPng bytes.Buffer

// Draws image
img := w.Draw()
// Encodes it
png.Encode(imgPng, img)
_ = png.Encode(&imgPng, img)

// Send it in a channel
sentImg, err := s.ChannelFileSend(i.ChannelID, "wordcloud.png", imgPng)
sentImg, err := s.ChannelFileSend(i.ChannelID, "wordcloud.png", &imgPng)
if err != nil {
lit.Error("Error while sending image " + err.Error())
return
Expand Down

0 comments on commit 1bb9770

Please sign in to comment.