Sfoglia il codice sorgente

Fixed err shadowing

Rens Rikkerink 6 anni fa
parent
commit
ee16996490
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 2 1
      state.go

+ 2 - 1
state.go

@@ -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