Do not panic if there is no location information

This commit is contained in:
jordi fita mas 2023-12-22 00:26:40 +01:00
parent 7028997e53
commit ee86b34e93
1 changed files with 3 additions and 1 deletions

View File

@ -62,7 +62,9 @@ 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 {
panic(err) if !database.ErrorIsNotFound(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 {