mirror of
https://github.com/harness/drone.git
synced 2025-05-05 15:32:56 +00:00
[fix]: [AH-1271]: fixed panic when we call this method with error or other types as input (#3737)
* [fix]: [AH-1271]: fixed panic when we call this method with error or values types as input * [fix]: [AH-1271]: fixed panic when we call this method with error or values types as input
This commit is contained in:
parent
ca888e532b
commit
7e85afab0e
@ -48,10 +48,13 @@ func IsEmpty(slice interface{}) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
if val.Kind() == reflect.Struct {
|
||||
return false
|
||||
kind := val.Kind()
|
||||
|
||||
if kind == reflect.Slice || kind == reflect.Array || kind == reflect.Map || kind == reflect.String ||
|
||||
kind == reflect.Chan || kind == reflect.Ptr {
|
||||
return val.Len() == 0
|
||||
}
|
||||
return val.Len() == 0
|
||||
return false
|
||||
}
|
||||
|
||||
func IsEmptyError(err errcode.Error) bool {
|
||||
|
Loading…
x
Reference in New Issue
Block a user