Skip to content

Commit

Permalink
Fix possible EditMedia sendOpts nil dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
demget authored and stek29 committed Dec 25, 2019
1 parent 921282a commit a855bcb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -825,11 +825,11 @@ func (b *Bot) EditMedia(message Editable, inputMedia InputMedia, options ...inte
Performer string `json:"performer,omitempty"`
}

sendOpts := extractOptions(options)
resultMedia := &FileJson{Media: mediaRepr}

resultMedia := &FileJson{
Media: mediaRepr,
ParseMode: sendOpts.ParseMode,
sendOpts := extractOptions(options)
if sendOpts != nil {
resultMedia.ParseMode = sendOpts.ParseMode
}

switch y := inputMedia.(type) {
Expand Down

0 comments on commit a855bcb

Please sign in to comment.