fix a nil deref in event page

This commit is contained in:
Ted Unangst 2019-12-16 17:36:04 -05:00
parent 87d0cabb67
commit f4760b06f7
1 changed files with 5 additions and 1 deletions

View File

@ -191,7 +191,11 @@ func geteventhonks(userid int64) []*Honk {
}) })
now := time.Now().Add(-24 * time.Hour) now := time.Now().Add(-24 * time.Hour)
for i, h := range honks { for i, h := range honks {
if h.Time.StartTime.Before(now) { t := h.Date
if tm := h.Time; tm != nil {
t = tm.StartTime
}
if t.Before(now) {
honks = honks[:i] honks = honks[:i]
break break
} }