From 5e85ae0d4e695b2d54c97cbb15e51ae4adb646a2 Mon Sep 17 00:00:00 2001 From: bitcodr Date: Fri, 7 Aug 2020 10:04:34 +0430 Subject: Fix nil error issue, Resolves https://github.com/google/fscrypt/issues/242 --- cmd/fscrypt/commands.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cmd/fscrypt/commands.go') 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) } -- cgit v1.2.3