summaryrefslogtreecommitdiffstats
path: root/lib/xdsconfig/config.go
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-05-13 23:13:42 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-05-13 23:13:42 +0200
commit87f390b37d51a4c8777d27836389e86e78c690d1 (patch)
treebe1089fa33f118f9bdf9e762a5f88a94ee0759d1 /lib/xdsconfig/config.go
parent7ecaccbae9b7741d8a285b98885e786dc1d4c79c (diff)
Fix invalid rootPath when creating a new project.
Diffstat (limited to 'lib/xdsconfig/config.go')
-rw-r--r--lib/xdsconfig/config.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/xdsconfig/config.go b/lib/xdsconfig/config.go
index df98439..801891b 100644
--- a/lib/xdsconfig/config.go
+++ b/lib/xdsconfig/config.go
@@ -186,6 +186,12 @@ func (c *Config) UpdateAll(newCfg Config) error {
// UpdateFolder updates a specific folder into the current configuration
func (c *Config) UpdateFolder(newFolder FolderConfig) (FolderConfig, error) {
+ // rootPath should not be empty
+ if newFolder.rootPath == "" {
+ newFolder.rootPath = c.ShareRootDir
+ }
+
+ // Sanity check of folder settings
if err := FolderVerify(newFolder); err != nil {
return FolderConfig{}, err
}