Do not panic if there is no location information
This commit is contained in:
parent
7028997e53
commit
ee86b34e93
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue