deal with fact split gives us empty strings

This commit is contained in:
Ted Unangst 2019-08-30 01:08:15 -04:00
parent 194c9a1223
commit f0deac732d
1 changed files with 9 additions and 3 deletions

12
honk.go
View File

@ -847,7 +847,9 @@ func getxonk(userid int64, xid string) *Honk {
h.Date, _ = time.Parse(dbtimeformat, dt)
h.Audience = strings.Split(aud, " ")
h.Public = !keepitquiet(h.Audience)
h.Onts = strings.Split(onts, " ")
if len(onts) > 0 {
h.Onts = strings.Split(onts, " ")
}
return h
}
@ -866,7 +868,9 @@ func getbonk(userid int64, xid string) *Honk {
h.Date, _ = time.Parse(dbtimeformat, dt)
h.Audience = strings.Split(aud, " ")
h.Public = !keepitquiet(h.Audience)
h.Onts = strings.Split(onts, " ")
if len(onts) > 0 {
h.Onts = strings.Split(onts, " ")
}
return h
}
@ -940,7 +944,9 @@ func getsomehonks(rows *sql.Rows, err error) []*Honk {
h.Date, _ = time.Parse(dbtimeformat, dt)
h.Audience = strings.Split(aud, " ")
h.Public = !keepitquiet(h.Audience)
h.Onts = strings.Split(onts, " ")
if len(onts) > 0 {
h.Onts = strings.Split(onts, " ")
}
honks = append(honks, &h)
}
rows.Close()