mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-04-27 18:08:04 -05:00
fix(filter): do not try to set timezone when doer does not exist
Resolves https://vikunja.sentry.io/issues/6025547266/events/e0d0a5fdf01c46a2ac9101d94ab4f304/
This commit is contained in:
@@ -673,13 +673,16 @@ func (l *UpdateTaskInSavedFilterViews) Handle(msg *message.Message) (err error)
|
||||
}
|
||||
|
||||
var fallbackTimezone string
|
||||
u, err := user.GetUserByID(s, event.Doer.GetID())
|
||||
if err == nil {
|
||||
fallbackTimezone = u.Timezone
|
||||
// When a link share triggered this event, the user id will be 0, and thus this fails.
|
||||
// Only passing the value along when the user was retrieved successfully ensures the whole handler
|
||||
// does not fail because of that.
|
||||
// When the fallback is empty, it will be handled later anyhow.
|
||||
if event.Doer != nil {
|
||||
var u *user.User
|
||||
u, err = user.GetUserByID(s, event.Doer.GetID())
|
||||
if err == nil {
|
||||
fallbackTimezone = u.Timezone
|
||||
// When a link share triggered this event, the user id will be 0, and thus this fails.
|
||||
// Only passing the value along when the user was retrieved successfully ensures the whole handler
|
||||
// does not fail because of that.
|
||||
// When the fallback is empty, it will be handled later anyhow.
|
||||
}
|
||||
}
|
||||
|
||||
taskBuckets := []*TaskBucket{}
|
||||
|
||||
Reference in New Issue
Block a user