Skip to content

Commit

Permalink
Fix unmarshal of empty dirsToCreate (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
urihoenig authored Apr 2, 2020
1 parent 86f7287 commit efcda32
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/flex/mounter.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ func (m *Mounter) Mount(targetPath string, specString string) *Response {
func (m *Mounter) createDirs(spec Spec, targetPath string) error {
var dirsToCreate []DirToCreate
if err := json.Unmarshal([]byte(spec.DirsToCreate), &dirsToCreate); err != nil {
return fmt.Errorf("Failed to parse dirsToCreate [%s]: %s", spec.DirsToCreate, err.Error())
if spec.DirsToCreate != "" {
return fmt.Errorf("Failed to parse dirsToCreate [%s]: %s", spec.DirsToCreate, err.Error())
}
return nil
}
for _, dir := range dirsToCreate {
if strings.HasPrefix(dir.Name, "/") {
Expand Down

0 comments on commit efcda32

Please sign in to comment.