Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The method encapsulates nil detection but cannot recognize it #260

Open
fidding opened this issue Jun 25, 2024 · 0 comments
Open

The method encapsulates nil detection but cannot recognize it #260

fidding opened this issue Jun 25, 2024 · 0 comments
Labels
needs triaging Requires triaging by the maintainers

Comments

@fidding
Copy link

fidding commented Jun 25, 2024

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 OrgInfo accessed field Id
@sonalmahajan15 sonalmahajan15 added the needs triaging Requires triaging by the maintainers label Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triaging Requires triaging by the maintainers
Projects
None yet
Development

No branches or pull requests

2 participants