diff --git a/protocol/base/incoming_message.go b/protocol/base/incoming_message.go index f6e4a56..3b42c1c 100644 --- a/protocol/base/incoming_message.go +++ b/protocol/base/incoming_message.go @@ -43,7 +43,12 @@ func (i *IncomingMessageImpl) Original() []byte { } func (i *IncomingMessageImpl) SetIncomingMessage(msg IncomingMessage) { - *i = interface{}(msg).(IncomingMessageImpl) + if msgImpl, ok := msg.(*IncomingMessageImpl); ok { + *i = *msgImpl + } else { + // Handle the error or panic + panic("msg is not of type *IncomingMessageImpl") + } } func (i *IncomingMessageImpl) GetKind() types.ProtocolMethod {