Reject selected catalog entries without source paths
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package config
|
||||
|
||||
import "fmt"
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// SelectSetting returns the source for a selected setting, or no source for an omitted selection.
|
||||
func (catalog ReferenceCatalogConfig) SelectSetting(id string) (string, error) {
|
||||
@@ -20,5 +23,8 @@ func selectReference(kind, id string, entries map[string]string) (string, error)
|
||||
if !ok {
|
||||
return "", fmt.Errorf("unknown reference catalog %s %q", kind, id)
|
||||
}
|
||||
if strings.TrimSpace(path) == "" {
|
||||
return "", fmt.Errorf("reference catalog %s %q has an empty source path", kind, id)
|
||||
}
|
||||
return path, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user