Code Review
/
src
/
xds
/
xds-server.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix invalid rootPath when creating a new project.
[src/xds/xds-server.git]
/
lib
/
xdsconfig
/
config.go
diff --git
a/lib/xdsconfig/config.go
b/lib/xdsconfig/config.go
index
df98439
..
801891b
100644
(file)
--- 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) {
// 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
}
if err := FolderVerify(newFolder); err != nil {
return FolderConfig{}, err
}