Skip to content

Commit

Permalink
fix nil bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ieee0824 committed Oct 12, 2017
1 parent fc3eba2 commit a579cf5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cryptex.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"io/ioutil"
"os"
"os/exec"
"fmt"
)

const (
Expand Down Expand Up @@ -196,6 +197,9 @@ func (c *Cryptex) Decrypt(d *Container) (interface{}, error) {
}

func (c *Cryptex) Edit(i *Container) (interface{}, error) {
if i == nil || i.Values == nil {
return nil, fmt.Errorf("container is empty")
}
p, err := c.decrypt(i.Values)
if err != nil {
return nil, err
Expand Down

0 comments on commit a579cf5

Please sign in to comment.