[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:
Pragyesh Mishra 2025-04-28 07:04:47 +00:00 committed by Harness
parent ca888e532b
commit 7e85afab0e

View File

@ -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 {