Skip to content

Commit

Permalink
bblfshctl: fix NPE in driver remove; fixes #214
Browse files Browse the repository at this point in the history
Signed-off-by: Denys Smirnov <[email protected]>
  • Loading branch information
Denys Smirnov authored and dennwc committed Nov 23, 2018
1 parent f1c65d7 commit cd80a49
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmd/bblfshctl/cmd/driver_remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,13 @@ func (c *DriverRemoveCommand) Execute(args []string) error {

for _, lang := range langs {
r, err := c.srv.RemoveDriver(ctx, &protocol.RemoveDriverRequest{Language: lang})
if err != nil || len(r.Errors) > 0 {
if err != nil {
return err
} else if len(r.Errors) != 0 {
for _, e := range r.Errors {
fmt.Fprintf(os.Stderr, "Error, %s\n", e)
}

return err
return fmt.Errorf("driver remove failed: %v", r.Errors)
}
}
return nil
Expand Down

0 comments on commit cd80a49

Please sign in to comment.