优化IsNil判断

This commit is contained in:
2024-08-13 16:30:16 +08:00
parent 3533617196
commit da44ae07ab
2 changed files with 8 additions and 2 deletions

View File

@ -71,7 +71,10 @@ func (ot *ObjectType) IsValid() bool {
//
// Date : 18:50 2023/6/1
func (ot *ObjectType) IsNil() bool {
return ot.source == nil
if ot.source == nil {
return true
}
return reflect.ValueOf(ot.source).IsNil()
}
// ToString 转字符串