goharbor / goharbor/harbor-cli
[bug]: nil pointer panic when deleting non-existent project robot
- Dominant language
- Go
- Stars
- 163
- Forks
- 211
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
## Description
Running `harbor project robot delete ` with a non-existent robot name causes a nil pointer panic.
The command prints the error from `GetRobotByName()` but continues execution and later crashes while accessing `robot.ID`.
## Steps to Reproduce
1. Run command: `harbor project robot delete non-existent-robot`
2. Use any invalid robot name
3. Observe the nil pointer panic
## Expected Behavior
The command should return the error gracefully without crashing.
## Actual Behavior
The CLI prints the error and then crashes with a nil pointer dereference panic.
## Environment
* OS: Any
* Tool version: harbor-cli main branch
* Other relevant details: Happens when the robot name does not exist
## Additional Context
Fix proposed in PR #890.
Contributor guide
Assessment
This issue has not been assessed yet.