Skip to content

Commit

Permalink
Fix null error when deleting a draft that no longer exists (#274)
Browse files Browse the repository at this point in the history
  • Loading branch information
InfiniteStash authored Jan 28, 2022
1 parent 033ef62 commit e07cf80
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/draft/draft.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ func Destroy(fac models.Repo, id uuid.UUID) error {
if err != nil {
return err
}
if draft == nil {
return fmt.Errorf("Draft not found: %v", id)
}

var imageID *uuid.UUID
switch draft.Type {
Expand Down

0 comments on commit e07cf80

Please sign in to comment.