nilaway
nilaway copied to clipboard
The method encapsulates nil detection but cannot recognize it
golang code:
// HasOrg 是否有机构
func (o *InfoOutput) HasOrg() bool {
if o == nil {
return false
}
if o.OrgInfo == nil {
return false
}
if o.OrgInfo.Id == "" {
return false
}
return true
}
func (o *InfoOutput) GetOrgName() string {
if !o.HasOrg() {
return ""
}
return o.OrgInfo.Name
}
but:
- org_user/info.go:45:9: field
OrgInfoaccessed fieldId