Skip to content

Commit efcda32

Browse files
author
urihoenig
authored
Fix unmarshal of empty dirsToCreate (#26)
1 parent 86f7287 commit efcda32

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/flex/mounter.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ func (m *Mounter) Mount(targetPath string, specString string) *Response {
6363
func (m *Mounter) createDirs(spec Spec, targetPath string) error {
6464
var dirsToCreate []DirToCreate
6565
if err := json.Unmarshal([]byte(spec.DirsToCreate), &dirsToCreate); err != nil {
66-
return fmt.Errorf("Failed to parse dirsToCreate [%s]: %s", spec.DirsToCreate, err.Error())
66+
if spec.DirsToCreate != "" {
67+
return fmt.Errorf("Failed to parse dirsToCreate [%s]: %s", spec.DirsToCreate, err.Error())
68+
}
69+
return nil
6770
}
6871
for _, dir := range dirsToCreate {
6972
if strings.HasPrefix(dir.Name, "/") {

0 commit comments

Comments
 (0)