fix: bad type conversion, and add a panic
This commit is contained in:
parent
be082fda60
commit
a59b7d44d6
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue