Skip to content

Commit ffd644a

Browse files
committed
stores/yaml: fix failing test (empty data)
Signed-off-by: Martin Holst Swende <martin@swende.se>
1 parent 377b6b4 commit ffd644a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stores/yaml/store.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ func (store *Store) LoadEncryptedFile(in []byte) (sops.Tree, error) {
294294
// sops.Tree runtime object
295295
func (store *Store) LoadPlainFile(in []byte) (sops.TreeBranches, error) {
296296
var branches sops.TreeBranches
297-
{
297+
if len(in) > 0 {
298298
// This is needed to make the yaml-decoder check for uniqueness of keys
299299
// Can probably be removed when https://github.com/go-yaml/yaml/issues/814 is merged.
300300
if err := yaml.NewDecoder(bytes.NewReader(in)).Decode(make(map[string]interface{})); err != nil {

0 commit comments

Comments
 (0)