mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-14 08:02:15 +03:00
check for empty response on migration settings (#2877)
(close #2872) (close #2862)
This commit is contained in:
parent
d1eeb3283c
commit
b39d7b977b
@ -160,13 +160,13 @@ func (h *HasuraDB) GetSetting(name string) (value string, err error) {
|
||||
return value, fmt.Errorf("Invalid result Type %s", hres.ResultType)
|
||||
}
|
||||
|
||||
if len(hres.Result) == 0 {
|
||||
if len(hres.Result) < 2 {
|
||||
for _, setting := range h.settings {
|
||||
if setting.GetName() == name {
|
||||
return setting.GetDefaultValue(), nil
|
||||
}
|
||||
}
|
||||
return "", nil
|
||||
return value, fmt.Errorf("Invalid setting name: %s", name)
|
||||
}
|
||||
|
||||
return hres.Result[1][0], nil
|
||||
|
Loading…
Reference in New Issue
Block a user