mirror of https://github.com/v2ray/v2ray-core
fix return value parsing
parent
4481cc36db
commit
07a7597ee8
8
v2ray.go
8
v2ray.go
|
@ -71,8 +71,12 @@ func (r *resolution) resolve(allFeatures []features.Feature) (bool, error) {
|
|||
ret := callback.Call(input)
|
||||
errInterface := reflect.TypeOf((*error)(nil)).Elem()
|
||||
for i := len(ret) - 1; i >= 0; i-- {
|
||||
if ret[i].Type().Implements(errInterface) {
|
||||
err = ret[i].Interface().(error)
|
||||
if ret[i].Type() == errInterface {
|
||||
v := ret[i].Interface()
|
||||
if v != nil {
|
||||
err = v.(error)
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue