Handle empty array_agg in I18nInput.FillArray
array_agg returns [null] instead of [] when it can not find any rows, thus the range enters the loop, but it fails to convert the null to string.
This commit is contained in:
parent
2cbdc21e53
commit
3d0f7b0dc1
|
@ -76,7 +76,11 @@ func (input I18nInput) FillValue(r *http.Request) {
|
||||||
|
|
||||||
func (input I18nInput) FillArray(array database.RecordArray) error {
|
func (input I18nInput) FillArray(array database.RecordArray) error {
|
||||||
for _, el := range array.Elements {
|
for _, el := range array.Elements {
|
||||||
tag, err := language.Parse(el.Fields[0].Get().(string))
|
lang := el.Fields[0].Get()
|
||||||
|
if lang == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
tag, err := language.Parse(lang.(string))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue