diff options
| author | bitcodr <bitcodr@gmail.com> | 2020-08-07 10:04:34 +0430 |
|---|---|---|
| committer | Eric Biggers <ebiggers3@gmail.com> | 2020-08-09 09:15:24 -0700 |
| commit | 5e85ae0d4e695b2d54c97cbb15e51ae4adb646a2 (patch) | |
| tree | a7c63fd36cc461a72b917431c91082572ac75fa0 /cmd | |
| parent | 95ad4868ac1f52f3d9c923e24f3d8c45dce6bb03 (diff) | |
Fix nil error issue, Resolves https://github.com/google/fscrypt/issues/242
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/fscrypt/commands.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/cmd/fscrypt/commands.go b/cmd/fscrypt/commands.go index 8058cb3..7c12356 100644 --- a/cmd/fscrypt/commands.go +++ b/cmd/fscrypt/commands.go @@ -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) } |