Skip to content

Commit 725ae0d

Browse files
author
Matthew Fisher
committed
fix(client): check if unit exists
1 parent 7bd1709 commit 725ae0d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

client/destroy.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ import (
99

1010
// Destroy units for a given target
1111
func (c *FleetClient) Destroy(target string) (err error) {
12+
// check if the unit exists
13+
if _, err := c.Units(target); err != nil {
14+
return err
15+
}
1216
component, num, err := splitTarget(target)
1317
if err != nil {
1418
return

0 commit comments

Comments
 (0)