Skip to content

Commit

Permalink
Fix a bug on execute endpoint
Browse files Browse the repository at this point in the history
- Fixed a bug on the execute endpoint where it would give an error if the command was present but the script was not
  • Loading branch information
cjlapao committed Nov 6, 2024
1 parent dee36d3 commit 13e1bd2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/models/virtual_machine_execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type VirtualMachineExecuteCommandRequest struct {
}

func (r *VirtualMachineExecuteCommandRequest) Validate() error {
if r.Command == "" || r.Script == nil {
if r.Command == "" && r.Script == nil {
if r.Script == nil {
return errors.NewWithCode("missing script", 400)
}
Expand Down

0 comments on commit 13e1bd2

Please sign in to comment.