misc: small fix or general refactoring i did not bother commenting

This commit is contained in:
evilsocket 2018-08-17 15:50:02 +02:00
parent 4206fd6a22
commit 1c3b9fc825
No known key found for this signature in database
GPG key ID: 1564D7F30393A456

View file

@ -83,6 +83,8 @@ func (s *TcpProxyScript) OnData(from, to net.Addr, data []byte) []byte {
return nil return nil
} }
// do we have any return value to override the buffer with?
if !ret.IsNull() && !ret.IsUndefined() {
exported, err := ret.Export() exported, err := ret.Export()
if err != nil { if err != nil {
log.Error("Error while exporting results: %s", err) log.Error("Error while exporting results: %s", err)
@ -97,6 +99,7 @@ func (s *TcpProxyScript) OnData(from, to net.Addr, data []byte) []byte {
return array return array
} }
}
return nil return nil
} }