aboutsummaryrefslogtreecommitdiff
path: root/cmd/fscrypt/commands.go
diff options
context:
space:
mode:
authorbitcodr <bitcodr@gmail.com>2020-08-07 10:04:34 +0430
committerEric Biggers <ebiggers3@gmail.com>2020-08-09 09:15:24 -0700
commit5e85ae0d4e695b2d54c97cbb15e51ae4adb646a2 (patch)
treea7c63fd36cc461a72b917431c91082572ac75fa0 /cmd/fscrypt/commands.go
parent95ad4868ac1f52f3d9c923e24f3d8c45dce6bb03 (diff)
Fix nil error issue, Resolves https://github.com/google/fscrypt/issues/242
Diffstat (limited to 'cmd/fscrypt/commands.go')
-rw-r--r--cmd/fscrypt/commands.go3
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)
}