Skip to content

Commit eab8950

Browse files
committed
Fix unreachable nil checks in SelectOrganization
Changed SelectOrganization() to return (nil, nil) instead of (nil, error) when no organizations are found. This allows the nil checks in login.go and switch.go to be reachable, enabling the friendly error message in login.go to be displayed as intended.
1 parent 21a68d3 commit eab8950

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/helpers/organization.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func SelectOrganization() (*Organization, error) {
4646
}
4747

4848
if len(organizations) == 0 {
49-
return nil, fmt.Errorf("no organizations found")
49+
return nil, nil
5050
}
5151

5252
if len(organizations) == 1 {

0 commit comments

Comments
 (0)