mirror of
https://github.com/bettercap/bettercap
synced 2025-07-08 05:51:37 -07:00
misc: small fix or general refactoring i did not bother commenting
This commit is contained in:
parent
4206fd6a22
commit
1c3b9fc825
1 changed files with 14 additions and 11 deletions
|
@ -83,19 +83,22 @@ func (s *TcpProxyScript) OnData(from, to net.Addr, data []byte) []byte {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
exported, err := ret.Export()
|
// do we have any return value to override the buffer with?
|
||||||
if err != nil {
|
if !ret.IsNull() && !ret.IsUndefined() {
|
||||||
log.Error("Error while exporting results: %s", err)
|
exported, err := ret.Export()
|
||||||
return nil
|
if err != nil {
|
||||||
}
|
log.Error("Error while exporting results: %s", err)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
array, ok := exported.([]byte)
|
array, ok := exported.([]byte)
|
||||||
if !ok {
|
if !ok {
|
||||||
log.Error("Error while casting exported value to array of byte: value = %s", exported)
|
log.Error("Error while casting exported value to array of byte: value = %s", exported)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return array
|
return array
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue