Skip to content

Commit

Permalink
Fix nil error issue
Browse files Browse the repository at this point in the history
  • Loading branch information
bitcodr authored and bitcodr committed Aug 6, 2020
1 parent 0972347 commit 5a41cd0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/fscrypt/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,9 @@ func addProtectorAction(c *cli.Context) error {
}
// Sanity check before unlocking everything
if err := policy.AddProtector(protector); errors.Cause(err) != actions.ErrLocked {
if err == nil {
err = errors.New("policy and protector are not locked!")
}
return newExitError(c, err)
}

Expand Down

0 comments on commit 5a41cd0

Please sign in to comment.