Commit 21a68d3
committed
fix: handle empty org list gracefully during login
SelectOrganization() returns (nil, nil) when the org list is empty.
Both `depot login` and `depot org switch` dereferenced the nil pointer,
causing a panic.
Now login completes successfully (token is saved) and prints a helpful
message when no orgs are found. org switch returns a clear error.
Made-with: Cursor1 parent 4f2273d commit 21a68d3
2 files changed
+9
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
49 | 55 | | |
50 | 56 | | |
51 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
| |||
0 commit comments