Fixed err shadowing

This commit is contained in:
Rens Rikkerink 2018-05-09 14:35:06 +02:00
parent 4cc57c5070
commit ee16996490
No known key found for this signature in database
GPG key ID: 204C7F94FBEC05FC

View file

@ -863,7 +863,8 @@ func (s *State) OnInterface(se *Session, i interface{}) (err error) {
}
case *MessageUpdate:
if s.MaxMessageCount != 0 {
old, err := s.Message(t.ChannelID, t.ID)
var old *Message
old, err = s.Message(t.ChannelID, t.ID)
if err == nil {
oldCopy := *old
t.BeforeUpdate = &oldCopy