Do not panic if there is no location information
This commit is contained in:
parent
7028997e53
commit
ee86b34e93
|
@ -62,8 +62,10 @@ func (p *PublicPage) Setup(r *http.Request, user *auth.User, company *auth.Compa
|
||||||
left join location_i18n as i18n on location.company_id = i18n.company_id and i18n.lang_tag = $1
|
left join location_i18n as i18n on location.company_id = i18n.company_id and i18n.lang_tag = $1
|
||||||
where location.company_id = $2
|
where location.company_id = $2
|
||||||
`, user.Locale.Language, company.ID).Scan(&p.OpeningDates); err != nil {
|
`, user.Locale.Language, company.ID).Scan(&p.OpeningDates); err != nil {
|
||||||
|
if !database.ErrorIsNotFound(err) {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if err := p.CompanyAddress.FillFromDatabase(r.Context(), conn, user, company); err != nil {
|
if err := p.CompanyAddress.FillFromDatabase(r.Context(), conn, user, company); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|
Loading…
Reference in New Issue